Where is CurrentCulture retrieved from in C# application

218 Views Asked by At

I have an application deployed across several servers

When I display CultureInfo.CurrentCulture.Name using System.Globalization, some sites display en-GB and some en-US

Where is this setting being picked up from? On a server that displays en-US, the region settings are English (United Kingdom) and the Language preferences have English (United Kingdom) ahead of English (United States)

Many thanks

1

There are 1 best solutions below

0
Orace On

First of all, it's important to note that the CultureInfo.CurrentCulture is a by thread static property.

Based on the documentation, if there is no user interventions, the original value is retrieved from a call to GetUserDefaultLocaleName (on windows systems).

Possible user interventions are:

  • Set the CultureInfo.CurrentCulture property.
  • Set the CultureInfo.DefaultThreadCurrentCulture property.