views:

49

answers:

3

Hi, I created a small WPF desktop application. I am thinking about how to make my application internationalized. Is there any Language Class to research (.NET 3.5 based)?

I want to load the my application language from windows region/language configuration automatically.

OR. some method to switch language from my application menu list.( no additional customize language package installation, assume the windowns system language packages support Chinese/English/Japanese/Korean already).

+1  A: 

I think System.Globalization contains all clases that you might need for this purpose. CultureInfo might suite your needs I think. Unfortunately I cannot provide more detail as I don't really have much of the experience in this area.

Maybe this link "Internationalization in .NET and WPF" will help you.

Jenea
+1  A: 

Have a look here: http://msdn.microsoft.com/en-us/library/ms788718.aspx#workflow_to_localize

You'll probably need to put your language-specific strings (and other data) into separate .resources.dlls. AS the application starts, .NET framework will loads the resources from the appropriate resource DLL (called a satellite DLL). The satellite DLLs are placed in the subfolders with the names like en-US or fr-CA at the folder where your main executable resides.

Vlad
+1  A: 

Have a look at the following articles. The idea to keep your labels coming from a resource file. And create different resource files for different locale. So when you know, upon user selection or you read from the OS settings, the locale you can load that resource file.

For instance, you have a label called lblName; then lblName.Text = GetResourceValue("lblName") would read the resource value from the resource file; assuming that you have the above method that returns the resource value from resource file.

  1. Walkthrough: Localizing Windows Forms
  2. .NET - Localization using Resource file
KMan