On Wed, Jul 22, 2009 at 2:03 AM, Sergey Semerikov<semeri...@gmail.com> wrote: > > I tried to translate the interface of the notebook using gettext and > faced with the need to make several changes to the source code:
Thanks for working on this!! (1) What is gettext? I've never heard of it? (2) Thanks for making the list below. Now we need to figure out how to get this into Sage in an incremental way. (3) Somebody else just popped up on the sage list a few days ago who is moving all the html generation code to jinja templates. His code is here: http://trac.sagemath.org/sage_trac/ticket/6568 This will obviously I think be relevant to what you're doing. I don't have a lot of time to work on the notebook now, but will in Sept - Dec. William > > 1) List of files for internationalization: > > - data/extcode/notebook/templates/ (may not be used?): > failed_login.template > login.template > register.template > yes_no.template > > - devel/sage/sage/server/notebook/templates/ : > account_recovery.html > account_settings.html > banner.html > base.html > base_authenticated.html > docs.html > error_message.html > history.html > list_top.html > login.html > registration.html > search.html > source_code.html > template_error.html > top_bar.html > upload.html > user_management.html > worksheet_listing.html > yes_no.html > > - devel/sage/sage/server/notebook/ : > > avatars.py > cell.py > colorize.py > conf.py > js.py > mailsender.py > notebook.py > notebook_object.py > register.py > run_notebook.py > sage_email.py > sagetex.py > smtpsend.py > template.py > tutorial.py > twist.py > user.py > worksheet.py > > 2) At the beginning of each file in devel/sage/sage/server/notebook/ > must specify the encoding UTF-8: > > # -*- coding: utf-8 -*- > > Config file for notebook, generated by function run() in file > run_notebook.py also must have such encoding: > > config.write(""" > # -*- coding: utf-8 - > *- ### > new addition > #################################################################### > > 3) Function convert_seconds_to_meaningful_time_span() must be > simplified, because in different languages differently shaped end of > words that denote the seconds, minutes and hours, depending on the > numerical value. For example, in Russian we must have different ends > for 1, 2-4, 5-... (in English - only for 1, 2-...). The proposed > simplification: > > def convert_seconds_to_meaningful_time_span(t): > if t < 60: > s = int(t) > return "%d second(s)"%s > if t < 3600: > m = int(t/60) > return "%d minute(s)"%m > if t < 3600*24: > h = int(t/3600) > return "%d hour(s)"%h > d = int(t/(3600*24)) > return "%d day(s)"%d > > 4) TEMPLATE_PATH in template.py should contain an indication of the > language catalog, e.g.: > TEMPLATE_PATH = sage.misc.misc.SAGE_ROOT + '/devel/sage/sage/server/ > notebook/en/templates' > > 5) Language selector (listbox) must be a part of the interface. > > 6) In local/notebook/javascript/tiny_mce/langs must be language packs > for TinyMCE. The TinyMCE configuration, generated in cell.py (lines > 199-213), must have one more parameter: > > language: "XX" > > "Stupid" (without gettext, directly changed files) Russian translation > can be download from http://semerikov.googlepages.com/ru.tar.bz2 > Unpack, copy, run 'sage -b' and try translated notebook. Screenshots: > http://semerikov.googlepages.com/russian_sage_login.png and > http://semerikov.googlepages.com/russian_sage_home.png > I think that making language packs for notebook interface (and docs > translation) will help to popularize Sage. I can also do the > translation into Ukrainian, but I need in a language pack template for > notebook (to easily add new languages as is done for the > documentation). > > > > -- William Stein Associate Professor of Mathematics University of Washington http://wstein.org --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---