473,408 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 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 1366
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: F. GEIGER | last post by:
When I start a py2exe-ed application I get the error 'ascii' codec can't encode character u'\xe9' in position 10: ordinal not in range(128) This is how I run py2exe: setup.py py2exe -O1...
10
by: Albretch | last post by:
.. Can you define the Character Set for particular tables instead of databases? . Which DBMSs would let you do that? . How do you store in a DBMS i18n'ed users' from input, coming over the web...
10
by: Albretch | last post by:
.. Can you define the Character Set for particular tables instead of databases? . Which DBMSs would let you do that? . How do you store in a DBMS i18n'ed users' from input, coming over the web...
66
by: jacob navia | last post by:
The english word "Initialized" exists. (Cambridge dictionary finds it). The word "Uninitialized" doesn't seem to exist, and no dictionary has it. I am using that word very often in my tutorial of...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.