I am working on multi Lingual application in c# asp.net MVC, in which server, client or both may have different languages other than English. My development machine has English as default language, and using language bar in windows, I have set my current language to French (belgium), my client end browser language is Dutch(belgium). For every request I used to change Thread Current Culture to Dutch(client end browser language) using globalization techniques as follows.
protected void Application_BeginRequest(object sender, EventArgs e)
{
HttpCookie userCookie = Request.Cookies["Culture"];
string cultureCode = "en-US";
if (userCookie != null)
{
cultureCode = userCookie.Value;
}
CultureInfo culture = new CultureInfo(cultureCode);
Thread.CurrentThread.CurrentCulture = culture;
Thread.CurrentThread.CurrentUICulture = culture;
}
I wanted to find OS current culture, therefore, I used
CultureInfo.InstalledUICulture
to find OS current culture, which should be French(Belgium) FR-BE, but every time it is returning me en-US English(united states). I already know that problem is with windows, it always returns default windows culture instead of current Culture as explained in this question. I wanted to know, is there any way to find current OS culture which is French(Belgium) FR-BE on my server.
<globalization uiculture...
instead (msdn.microsoft.com/en-us/library/vstudio/…) – Alexei Levenkov