I need to change the current culture of the application to th-TH I have tried to do this to create an object of the following type and I intend to assign it to the current thread's CurrentCulture Property
System.Threading.Thread.CurrentThread.CurrentCulture =
new System.Globalization.CultureInfo("en-US");
But the .NET Compact edition that I am using does not have the CurrentCulture property available in the System.Threading.Thread.CurrentThread
property.
Is there a way in which we can do this?
Edit : I can change the Regional setting of the Mobile device and then when I run the application I am able to get the Correct text from the correct resource files.
But I am not able to get the correct resource when Install the application using a setup project
This is what I have done.
I have also verified that the reqired folders such as fr-CA,th-TH etc are being created in the same directory where the .exe of my application is present
According to MSDN, this is impossible.
You cannot set current culture programmatically on a device. They are set by the device manufacturer or manually configurable by the device user, such as with Regional Settings on a Pocket PC running Windows CE or Windows CE .NET, current culture settings are on a per-device basis.
However, I did find an article on Code Project that proposed a solution to this problem.
Basically, the author created his own ResourceManager and base form, meaning this solution will probably not be very easy to apply to existing compact framework applications.
Depending on your application's complexity you might want to consider implementing some kind of ResourceManager yourself, or use the one from the Code Project article.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With