View previous topic :: View next topic |
Author |
Message |
dbrillon
Joined: 31 Aug 2009 Posts: 3
|
Posted: Mon Aug 31, 2009 3:54 am Post subject: Start Application alway run in Default language |
|
|
When I try to test my translation with the "Start Application" button I always get the default language (English) even if I select french or any other language defined. All my paramters have been translated. If I try my application on a French OS by moving my application executable and the floder FR then everything is working properly.
What am I doing wrong?
Regards,
David |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Mon Aug 31, 2009 6:13 am Post subject: |
|
|
The Start Application button changes the locale for the current windows user to that specified then starts the application. This is the same as changing your locale from Control Panel (under Regional and Language options) then starting the application. The thread culture of your application is automatically set to the windows user culture by the .NET framework - however the culture of the resources loaded by .NET is determined a seperate Thread.UICulture property.
If you wish to be able to run your application with the French translations on a non-French OS then it is common practice to set the UICulture of your application to match the thread CurrentCulture before any forms are loaded. You do this by adding the line of code:
Code: | Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture; |
In the main() method or in the main form constructor before InitializeComponent is called. The sample projects illustrate this. Once you have done this your application will start with the UI culture determined by the current window culture and the Globalizer.NET Start Application will also be able to work.
The UICulture property is set by the .NET framework by default to match the windows OS culture. That is why when you run your application on a French OS you are seeing the translated resources. _________________ Infralution Support |
|
Back to top |
|
|
dbrillon
Joined: 31 Aug 2009 Posts: 3
|
Posted: Mon Aug 31, 2009 12:36 pm Post subject: |
|
|
Thanks for the answer.
I thought your product was doing this to help the translator see the results without changing the application or the OS. This was the behavior I was expecting when I select the start application and the language menu. I think this is a little bit misleading for new users.
From the small test I did, except for this behavior that get me puzzle for a while, I really like your product. I will complete my test with a real project and if everything run smoothly we will definitively use this product.
Regards,
David |
|
Back to top |
|
|
|