Google Search: C#, Finding the Locale
This post discusses how to determine a user's locale in C#. For ASP.NET applications, the Request.UserLanguages
array provides the user's preferred languages, with the first element being the primary locale. This can be used to set the thread's culture using CultureInfo.CreateSpecificCulture()
. In Windows Forms or services, the current culture can be accessed via Thread.CurrentThread.CurrentCulture
and several properties like TwoLetterISOLanguageName
or DisplayName
allow retrieval of locale information.