I am writing a program in C# for a Windows CE device and would like the application to be translated according to a language setting in the application itself.
I have already read some articles about localisation using resource files and translating forms using the ‘Localizable’ and ‘Language’ properties. From what I have read I understand that this type of form translation works with the OS language setting (correct me if I am wrong).
Now I am looking for a way to do the form translation dependent on my own in-program language setting, preferably using resource files.
I have already thought of doing this translation in the Load event of each form but maybe there are other solutions or best-practice for this. Any help is appreciated.
If you use the Language.resx, Language.[language]-[country].resx way of localizing, the generated class Language will have a property named Culture that can be set to override the current system culture.
If you want to use the ResourceManager-class it has a member GetResourceSet() that takes a parameter CultureInfo. I haven’t tried to use GetResourceSet myself but it sounds like something you could use.
MSDN-link:
http://msdn.microsoft.com/en-us/library/system.resources.resourcemanager.getresourceset(v=vs.80).aspxo