4

解决方案: 使用 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

我找不到“电话语言”

4

2 回答 2

6

使用System.Threading.Thread.CurrentThread.CurrentCulture. 它应该正确反映电话语言。

于 2013-01-25T11:13:46.087 回答
0

您可以查看我的答案,这将帮助您在运行时更改语言: https ://stackoverflow.com/a/17131401/2467917

于 2013-06-16T08:53:22.833 回答