471,881 Members | 1,343 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,881 software developers and data experts.

[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 1269
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 Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.