gettext again

cantabile cantabile.03 at wanadoo.fr
Tue Aug 9 17:59:26 EDT 2005


stas a écrit :

> As a reminder, make sure that you install gettext in the namespace
> of your toplevel module.
> What I mean is this:
> 
> test1.py imports test2.py and test3.py
> test2.py imports test4.py
> 
> Now you have to place the gettext.install call in test1.py and
> then the other modules can access it.
> If you place the gettext call in, for example, test2.py then only
> test2.py and test4.py have access to it.
> So when it don't work as you expect make sure to check if every
> module has access to the "_" from gettext.
Noticed something :
I must import test2.py AFTER gettext.install('test1') and even then, if 
test3.py imports test2.py, messages won't be translated in test3.py. I 
have to import test3.py in test1.py too.
Is this normal behaviour or is there something I'm missing (again) ?

PS : your project looks nice !



More information about the Python-list mailing list