469,336 Members | 5,507 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,336 developers. It's quick & easy.

[i18n] Multilang. app in Python (English, French, German)?

Is there a way to do this in a professional manner?

For now I only can think of having all strings in a file, read them into
a dict at startup and then access them like so:

print str(MyTextDict('e', "errorOnDbStore"))

or

print str(MyTextDict('f', MyTextDict._ErrorKey_ErrorOnDbStore))

Is it this or is there a "more Pythonic" way?

Kind regards
Franz GEIGER

P.S.: I'm on Windows and use wxPython for the GUI part. I intend to be
able to select the language in an INI file before starting the app.

Jul 18 '05 #1
3 1207
F. GEIGER wrote:
Is there a way to do this in a professional manner?

For now I only can think of having all strings in a file, read them into
a dict at startup and then access them like so:

print str(MyTextDict('e', "errorOnDbStore"))

or

print str(MyTextDict('f', MyTextDict._ErrorKey_ErrorOnDbStore))

Is it this or is there a "more Pythonic" way?

Kind regards
Franz GEIGER

P.S.: I'm on Windows and use wxPython for the GUI part. I intend to be
able to select the language in an INI file before starting the app.


wxPython has functionality in place for i18n (propably similar to what
gettext does, which means it involves .po files - which are message
catalogs). Look at the chapter "internationalization" in the wxWidgets
documentation, its under "Topics Overview".

--
Vincent Wehren
Jul 18 '05 #2
See the Gettext module ?
Jul 18 '05 #3
Thank you, Michel and Vincent,

I went for the gettext module - a very comfortable way to manage multilang
strings, indeed.

Kind regards
Franz GEIGER

"F. GEIGER" <f.******@vol.at> schrieb im Newsbeitrag
news:cd**********@newshispeed.ch...
Is there a way to do this in a professional manner?

For now I only can think of having all strings in a file, read them into
a dict at startup and then access them like so:

print str(MyTextDict('e', "errorOnDbStore"))

or

print str(MyTextDict('f', MyTextDict._ErrorKey_ErrorOnDbStore))

Is it this or is there a "more Pythonic" way?

Kind regards
Franz GEIGER

P.S.: I'm on Windows and use wxPython for the GUI part. I intend to be
able to select the language in an INI file before starting the app.

Jul 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.