Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > [i18n] Multilang. app in Python (English, French, German)?

Reply
Thread Tools

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

 
 
F. GEIGER
Guest
Posts: n/a
 
      07-15-2004
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.

 
Reply With Quote
 
 
 
 
Michel Claveau, résurectionné d'outre-bombe informatique
Guest
Posts: n/a
 
      07-15-2004
See the Gettext module ?


 
Reply With Quote
 
 
 
 
vincent wehren
Guest
Posts: n/a
 
      07-15-2004
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
 
Reply With Quote
 
F. GEIGER
Guest
Posts: n/a
 
      07-18-2004
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" <(E-Mail Removed)> schrieb im Newsbeitrag
news:cd6hpd$ute$(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
the easiest way to convert a .net windows app to web app? tom ASP .Net 4 10-24-2008 05:57 PM
1 server, 2 web sites 1 asp.net app each, build one, other -> Server App Unavailable Dave Diehl ASP .Net 4 08-11-2004 12:52 PM
newbie question: embedding Python into a C++ app and calling app functions davout Python 0 08-04-2004 03:26 PM
win app and web app mimi ASP .Net 1 07-29-2004 03:19 AM
Asp.net app, Unable to load dll!!, while same dll loads properly in Win form app NGM ASP .Net 0 11-06-2003 10:34 AM



Advertisments