« Return to Thread: Re: how to localize a common dialog box

Re: Re: how to localize a common dialog box

by Karsten Hilbert :: Rate this Message:

Reply to Author | View in Thread

On Thu, Jul 10, 2008 at 02:42:41PM +0200, Werner F. Bruhin wrote:

> Note that you can use gettext and local or wx.GetTranslation and  
> wx.Locale, you should use the later if you want wxPython standard  
> strings to be translated

Note that this is NOT a requirement for wxPython-internal
strings (such as stock button labels) to be translated. BOTH
ways work. All one needs to make sure is that the normal
Python library locale/gettext modules are imported and
initialized *before* wxPython is imported. But that would be
Good Practice anyway.

The reason being that, apparently, during its startup
wxPython detects the currently activated system locale and
adjusts itself to that. So, if the Python library module
locale.setlocale(locale.LC_ALL) was called appropriately,
wxPython will automatically be in the right locale, too.
This is perfectly sane from a software engineering point of
view as wxPython is a layer on top of Python (and other
things) so as long as Python did the right thing early
enough wxPython should, too (and it does).

> and when you distribute your application you  
> should not forget to include the appropriate language.mo files from the  
> wxPython version you are using.
That advice is prudent but only applies on Windows. On Linux
and/or Mac make sure to have the package manager install any
needed i18n dependancy packages.

Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346
_______________________________________________
wxpython-users mailing list
wxpython-users@...
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

 « Return to Thread: Re: how to localize a common dialog box