如何检测的Windows Phone 8.1操作系统语言 [英] How to detect OS language in Windows Phone 8.1

查看:178
本文介绍了如何检测的Windows Phone 8.1操作系统语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我用之前:

  System.Threading.Thread.CurrentThread.CurrentCulture 

如何做到这一点在Wp8.1。而为什么所有的过时的东西,没有一个良好的文档,你可以使用的,而不是像在Xcode?

解决方案

的CultureInfo。的CurrentCulture用于返回该地区的格式设置。 WP 8.1仿佛回到了Package.appxmanifest设置默认语言。



均田很烂,不是吗? :)



我认为这计划,因为他们想引导我们走向使用 GlobalizationPreferences 来代替。所以,要回你想要什么....你需要做的是这样的:

  CultureInfo的CI =新的CultureInfo( Windows.System.UserProfile.GlobalizationPreferences.Languages [0]); 



这基本上是基于创建的CultureInfo他们更喜欢顶级语言(我认为这是显示UI)。



祝你好运:)


So before I used:

 System.Threading.Thread.CurrentThread.CurrentCulture

How to do it in Wp8.1. And why all the deprecated things dont have a good documentation what you can use instead like in xCode?

解决方案

CultureInfo.CurrentCulture used to return the region format setting. WP 8.1 seems to return the default language set in the Package.appxmanifest.

Kinda sucks doesn't it? :)

I think it is planned because they want to steer us towards using GlobalizationPreferences instead. So to get back to what you want....you need to do something like this:

CultureInfo ci = new CultureInfo(Windows.System.UserProfile.GlobalizationPreferences.Languages[0]);

It basically creates a CultureInfo based on their prefer top language (which I think is the display UI).

Good luck :)

这篇关于如何检测的Windows Phone 8.1操作系统语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆