[Gambas-user] Change translations at runtime

Benoît Minisini gambas at ...1...
Thu Feb 26 14:23:15 CET 2009


> I have a program that runs the same way. Unfortunately, for
> translations to take place, all translated objects must be destroyed
> and re-created under the new environment.
>
> The first time around, I created a loop to restart the application
> after setting the right environment.
> Later, I realized that I could do it without having to restart the
> entire application.
>
> You can do it by using a class or module as startup class, and if you
> are offering a language selection, of course, your first window will
> always show up in the language defined by LANG.
> Anything after that will be shown in the language selected by the user.
>
> I have seen python applications, where you click a language in a list
> and everything in the form translates immediately...the screen doesn't
> even flash.
>
> I wonder if gambas could implement someting like that some day
>

First, you must set the System.Language property, which reload the translation 
file. But it does not change the text in already opened windows. So you must 
do that "by hand".

Regards,

-- 
Benoît




More information about the User mailing list