xcristi 0 Newbie Poster

Hello everyone,

I try to build a python application based on pygtk. For GUI development I used glade3 with the option translatable strings.

I've created all the PO, MO files needed, starting application with different LANG constants in command line gives me expected results.

My goal is to be able to change language inside the application, and not only based on locale settings.

If I put in __init__.py

for module in gtk.glade, gettext:
    module.bindtextdomain(GETTEXT_DOMAIN, LOCALE_PATH)
    module.textdomain(GETTEXT_DOMAIN)

lang = gettext.translation(GETTEXT_DOMAIN, LOCALE_PATH, languages=['ro'], fallback = True)
lang.install()

print _("_File")

the _File is translated correctly (GETTEXT_DOMAIN, LOCALE_PATH defined above, no problem about that). lang.install() seems to work ok, _() is present. But not in the glade file! So, if I have some string to be translated inside my modules, it works, but not for glade file.

This file seems anyway to be translated correctly when I use LANG.

So, for some reason, in glade file, translation is not done with _() provided by lang.install()

Have any idea?
Thanks