on-the-fly translation with gettext

Benjamin Sigonneau benjamin at dromaludaire.info
Wed Sep 17 06:24:10 EDT 2008


Mike Driscoll <kyosohma at gmail.com> writes:

> On Sep 16, 4:57 am, Benjamin Sigonneau <benja... at dromaludaire.info>
> wrote:
>> Hi all,
>>
>> I'm a complete beginner in python and in GUI designing, yet I'm writing
>> a GUI using python and Tkinter.  I need it to be available both in french
>> and english, so I read the Fine Manual and gave a try to gettext.
>>
> [...]
>> However, I'd like to let the user show the language on-the-fly during
>> execution.  Having read the Python Library Reference, sec. 21.1.3.3
>> (seehttp://docs.python.org/lib/node740.html), I added a menu with two
>> radiobuttons and I merely set them up to call install_lang:
>
> [...]
>
>> However, there is no magic.  The language of the application remains
>> unchanged.  If it was defined to be english at startup, so will it
>> remain.  Conversely, it will stay in french if this was the language at
>> startup.
>
> Try moving another window across your application after you change
> languages and see if it gets updated. Sometimes you need to refresh
> the layout of your application to get it to work...at least, in
> wxPython you do.


I tried it, but unfortunately my problem remains.  Anyway, thanks for
the advice.


-- 
benjamin



More information about the Python-list mailing list