I found one interesting thing in CultureInfo class. I was writting an app in ASP.NET and I was using Thread.CurrentThread.CurrentCulture
to get the current selected language and:
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo(alias);
There was 2 places where I can set the culture of the current thread in one place I was doing like these:
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("ru");
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("ru-RU");
Then I suddenly found that the culture (1) is different then culture (2) but both of them are Russian.
Am I doing something wrong or the Microsoft is drunk?
EDIT
@Tim Schmelter
var culture = CultureInfo.GetCultureInfo("ru");
var culture2 = CultureInfo.GetCultureInfo("ru-RU");
if (Equals(culture, culture2))
{
Console.Write(true);
return;
}
Console.Write(false);
The question is - "why does Microsoft separates "ru" and "ru-RU"?
get the current selected language
. – BolingRegion
or the geo location of the language being spoken, etc etc – Strafedrunk
. So theTwoLetterISOLanguageName
propertie is not the unique key for the CultureInfo. – Increateru-KZ
orru-LV
, besidesru-RU
. Already, a language like Spanish has manyCultureInfo
(about 20) includinges-ES
(Spanish (Spain)),es-AR
(Spanish (Argentina)),es-US
(Spanish (United States)). – Coquelicot