解决方案: 使用 CultureInfo.CurrentUICulture
用户可以在以下位置更改 Windows Phone 的系统语言:设置 > 语言+地区 > 手机语言
如何从 C# 代码中获取所选语言(电话语言)?
下面是我的手机设置:
这是我的代码片段:
System.Diagnostics.Debug.WriteLine(
"************************************* CultureInfo.CurrentCulture.Name = " + CultureInfo.CurrentCulture.ToString() + ", " +
"CultureInfo.CurrentCulture.CompareInfo = " + CultureInfo.CurrentCulture.CompareInfo + ", " +
"CultureInfo.CurrentCulture.DisplayName = " + CultureInfo.CurrentCulture.DisplayName + ", " +
"CultureInfo.CurrentCulture.EnglishName = " + CultureInfo.CurrentCulture.EnglishName + ", " +
"CultureInfo.CurrentCulture.Name = " + CultureInfo.CurrentCulture.Name + ", " +
"CultureInfo.CurrentCulture.NativeName = " + CultureInfo.CurrentCulture.NativeName + ", " +
"CultureInfo.CurrentCulture.TextInfo = " + CultureInfo.CurrentCulture.TextInfo
);
这是输出:
CultureInfo.CurrentCulture.Name = zh-HK,
CultureInfo.CurrentCulture.CompareInfo = CompareInfo - zh-HK,
CultureInfo.CurrentCulture.DisplayName = Chinese (Traditional, Hong
Kong SAR), CultureInfo.CurrentCulture.EnglishName = Chinese
(Traditional, Hong Kong SAR), CultureInfo.CurrentCulture.Name = zh-HK,
CultureInfo.CurrentCulture.NativeName = 中文(香港特別行政區),
CultureInfo.CurrentCulture.TextInfo = TextInfo - zh-HK
我找不到“电话语言”