[英]Why we get the same CultureInfo.LCID from CultureInfo.GetCultures(CultureTypes.AllCultures)
Our code is simple, get the cultures and put them in a dropdown list control. 我们的代码很简单,了解区域性并将它们放在下拉列表控件中。
items = new SortedDictionary<int, string>();
foreach (CultureInfo info in CultureInfo.GetCultures(CultureTypes.AllCultures))
{
string value = string.Format(System.Globalization.CultureInfo.CurrentCulture, "{0} - {1}", info.LCID, info.DisplayName);
if (!items.ContainsKey(info.LCID))
{
items.Add(info.LCID, value);
}
}
We want to use LCID as our key to the dictionary. 我们想使用LCID作为字典的键。
However, sometimes we get the same LCID value, for example, when LCID is 4, the displayname is "Chinese (Simplified)" or "Chinese (Simplified) Legacy", what it the difference between these CultureInfo ? 但是,有时我们会获得相同的LCID值,例如,当LCID为4时,显示名称为“中文(简体)”或“中文(简体)传统”,这两个CultureInfo有什么区别?
Can we still use LCID as the key ? 我们还可以使用LCID作为密钥吗?
Thanks for your answer 感谢您的回答
"Chinese (Simplified)" and "Chinese (Simplified) Legacy" refers to the same culture (same LCID). “简体中文”和“繁体中文”是指相同的文化(相同的LCID)。 You can use LCID as the key.
您可以使用LCID作为密钥。
This was a change introduced in .NET Framework 4 to follow the naming convention LanguageName ([Script,] Country/RegionName). 这是.NET Framework 4中引入的更改,以遵循命名约定LanguageName([Script,] Country / RegionName)。
The display names of Chinese cultures have changed to follow the naming convention LanguageName ([Script,] Country/RegionName).
中国文化的显示名称已更改为遵循命名约定LanguageName([Script,] Country / RegionName)。 In the .NET Framework 4, the word "Legacy" has been appended to the zh-CHS and zh-CHT display names to differentiate them from zh-Hans and zh-Hant.
在.NET Framework 4中,单词“ Legacy”已附加到zh-CHS和zh-CHT显示名称中,以区别于zh-Hans和zh-Hant。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.