PyGTK localisation on Win32

Dieter Verfaillie dieterv at
Sun Mar 30 12:49:42 CEST 2008

On Thu, 2008-03-27 at 05:21 -0700, Sukhov Dmitry wrote:
> I have the same problem. I did all as you wrote. gettext translations
> do work fine. But translations in glade does not work.
> The only way to turn it on is to set environment variable LANG
> explicitly before program run:
> set LANG=ru_RU
> python

Yep, from python 2.4 on, os.environ changes only work within python and
no longer apply to low level c stuff on win32. Luckily, it's still
possible to force environment variables through the
kernel32.SetEnvironmentVariableW and msvcrt._putenv functions.

Put the attached locale module in a libi18n package and use like this:
#!/usr/bin/env python
from libi18n import locale
del locale

-------------- next part --------------
A non-text attachment was scrubbed...
Type: text/x-python
Size: 13405 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: This is a digitally signed message part
URL: <>

More information about the Python-list mailing list