Terry J. Reedy <tjre...@udel.edu> added the comment:

In the last few months, configdialog has been refactored to have a class for 
each settings tab.  This makes it easier to revise and add new options, such as 
'menu language'.

With this done, the IDLE features implemented as (optional) extensions were 
turned into normal features.  Non-key option settings were moved to the General 
tab. The menu items were moved to mainmenu.py.  Having everything in one place 
should make translation easier.  When making further menu system changes, I 
will keep I18n in mind.

AFAIK, there is no runtime need to have 60+translation calls in the invisible 
mainmenu.menudefs structure, which would make it harder to read.  I would 
rather change the 'label=name' option in menu item insertion calls to 
'label=_(name)' or 'label=gettext(name)' or possibly 'label=trandict[name].  In 
macosx the explicit "label='window'" would need the same change.  So would the 
scattered context menu insertion calls.

Just for translating the menu, gettext seems possibly like overkill.  I remain 
reluctance to use it without my questions above answered.  Another question: 
can the automatic selection mechanism be overridden by the user?

All that is needed is a simple template file that creates a translation 
dictionary  I think translation would be easiest if the template preserved both 
the order and hierarchical structure.  It would be trivial to write a function 
to create a full version of the following.

trandict = {
    'file': 
        '_New File':
        ...
    ...
}
[Note: top level names like 'file' are lowercased in menudefs but then 
capitalized in the menu.  Maybe they should be uppercased to start with.]

The output instead could match what whatever the gettext machinery requires.  I 
don't know if the gettext extractor preserves the order, but I am sure it will 
not preserve the structure.

Recently, translations were added to the official doc site.  A translation of 
the IDLE section should have a good-enough translation of the menu that can be 
extracted into a dict for IDLE.  The only problem is that they will not have 
the underscores for hot keys.  I don't know if these are universally used.

The Japanese translation includes the IDLE section.  The top level names (File, 
Edit, ... Help) are not tranlated.  Perhaps the team felt that such terms 
should be familiar enough to Japanese users to not need translation.  The 
dropdown menu labels *are* translated, but keep the English, as in
'New File [新規ファイル]'.     In any case, this is enough for experiments.

----------
assignee:  -> terry.reedy
versions: +Python 3.7 -Python 2.7, Python 3.4, Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue17776>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to