所以我不能将默认设置为英语,就像这样
CultureInfo MyCulture = CultureInfo.ENGLISH;
或
CultureInfo MyCulture = CultureInfo.getCultureInfo(CulureInfo.Eng);
我必须使用列表I found on the internet(或创建我自己的枚举)来引入字符串依赖项:
CultureInfo MyCulture = CultureInfo.getCultureInfo("en-AU");
那么是否已经有一个枚举或其他类型的所有可用CultureInfos
列表?
答案 0 :(得分:3)
您可以使用System.Globalization类获取iso语言和区域名称:
System.Globalization.CultureInfo[] cinfo = System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.AllCultures & ~System.Globalization.CultureTypes.NeutralCultures);
System.Globalization.RegionInfo ri = null;
foreach (System.Globalization.CultureInfo cul in cinfo)
{
try
{
ri = new System.Globalization.RegionInfo(cul.Name);
Console.WriteLine(cul.TwoLetterISOLanguageName+"-"+ri.TwoLetterISORegionName);
}
catch(ArgumentException)
{
continue;
}
}