Re: [Gambas-user] Change translations at runtime
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 -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Change translations at runtime
Thanks Benoît and M0E, it works. But as you said, I must reload the main form after this command. No problem anyway, because at the moment I'm using it only for debugging purposes. Cheers Jesús Guardón Benoît Minisini escribió: 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, -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
[Gambas-user] Change translations at runtime
Hi I know that this issue has been addressed earlier in the list, but has not been answered yet. I have a translated project in English, Spanish, Catalan, etc. Thanks to an Stefano Palmeri's reply on Jun 06, 2007, I can see the program running in a different language on the console by typing export LANG=xx_XX and then run my application. This works fine, but is it possible to do so from within the running program? Ie, allow the user to switch between languages at runtime? Thanks in advance Jesús -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Change translations at runtime
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 -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user