Windows 运行时:如何获取用户的首选语言列表?
WinRT 类型的某些构造函数接受语言的 IEnumerable
来尝试解析语言选择。例如,有 a Windows.Globalization.NumberFormatting。 CurrencyFormatter
构造函数,它采用语言列表来尝试确定货币格式化程序的语言选择。
我知道访问用户语言的唯一方法是默认构造 Windows.Globalization.Language
对象并访问 Id
属性。如果用户设置了首选语言列表,如何才能按照他们指定的优先级顺序获取完整列表?
Some constructors of WinRT types accept an IEnumerable<string>
of languages to try in resolving a choice of language. For example, there is a Windows.Globalization.NumberFormatting.CurrencyFormatter
constructor that takes a list of languages to try in determining the choice of language of the currency formatter.
The only method I know of to access the user's language is to default-construct a Windows.Globalization.Language
object and access the Id
property. If the user has set a list of preferred languages, how is it possible to obtain the full list in the priority order that they specified?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这个属性正是您所需要的:
GlobalizationPreferences.Languages
。请参阅 MSDN 页面上的 GlobalizationPreferences 类 了解更多信息。I think this property is what you need:
GlobalizationPreferences.Languages
. See the MSDN page on the GlobalizationPreferences class for more info.