views:

33

answers:

3

We have just started exploring what required for internationalizing our applications. One thing I'm not clear on is how the .NET Framework decides what language/culture to use when displaying messages to users etc. Does it do this based on the version of Windows (French, German etc.) installed and/or the region/location selected in any version of Windows?

Thanks very much.

+1  A: 

It uses both pieces of information.

The 2 main properties here are Thread.CurrentCulture and Thread.CurrentUICulture

  • The CurrentCulture is used to determine the (default) formatting, ie 31-12-2009 or 12/31/2009.
  • The CurrentUICulture determines which resources to load.

You can change both properties but usually they are set correctly by the Framework on startup.

Henk Holterman
Also see [Should I set Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture by default in my app?](http://stackoverflow.com/q/511293/60761)
Henk Holterman
A: 

It uses culture and ui culture you set in the regional settings from control panel. If the application doesn't have internationalized resources for that culture, it uses default ones.

Ivan Ferić
+2  A: 

This article explains the influence of control panel settings and the installed Windows language on the CurrentCulture and CurrentUICulture properties:

http://en.csharp-online.net/Localization_Like_the_Pros%E2%80%94CurrentCulture_and_CurrentUICulture

Bob