[pygtk] Setting GTK locale
Fredrik Corneliusson
fredrik.corneliusson at gmail.com
Fri Dec 3 20:46:42 WST 2010
Hi,
I'm localizing a PyGTK application (win32 & py2exe).
As my target audience is multilingual and might not want to have the
user interface language set to the system default I have made it
configurable.
This works for the custom strings in my application but not for the
built in GTK messages. You can change the locale by setting the LANG
environment variable manually _before_ starting the application but
that is sub optimal as the user selected locale is stored in a config
file in users settings directory.
Setting the environment variable after Python has started has no
effect on GTK (even if I do it before loading any GTK modules).
I even tried to use gtk.disable_setlocale as the first thing in the script:
>>>import gtk
>>>gtk.disable_setlocale()
but I still get a warning that it must be called before gtk_init:
"GTK Warning: gtk_disable_setlocale() must be called before gtk_init()"
Is there some other way to alter the locale so it is respected by GTK?
Regards,
Frredrik
More information about the pygtk
mailing list