Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/273.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在Windows Phone 8.1中检测操作系统语言_C#_Windows_Xaml_Windows Phone_Detect - Fatal编程技术网

C# 如何在Windows Phone 8.1中检测操作系统语言

C# 如何在Windows Phone 8.1中检测操作系统语言,c#,windows,xaml,windows-phone,detect,C#,Windows,Xaml,Windows Phone,Detect,所以在我使用之前: System.Threading.Thread.CurrentThread.CurrentCulture 如何在Wp8.1中实现它。为什么所有不推荐的东西都没有一个好的文档,您可以像在xCode中那样使用它?CultureInfo.CurrentCulture用于返回区域格式设置。WP 8.1似乎返回Package.appxmanifest中设置的默认语言。 有点糟糕,不是吗?:) 我认为这是有计划的,因为他们想引导我们使用全球化首选项。所以,要想回到你想要的……你需要做

所以在我使用之前:

 System.Threading.Thread.CurrentThread.CurrentCulture

如何在Wp8.1中实现它。为什么所有不推荐的东西都没有一个好的文档,您可以像在xCode中那样使用它?

CultureInfo.CurrentCulture用于返回区域格式设置。WP 8.1似乎返回Package.appxmanifest中设置的默认语言。

有点糟糕,不是吗?:)

我认为这是有计划的,因为他们想引导我们使用
全球化首选项
。所以,要想回到你想要的……你需要做如下的事情:

CultureInfo ci = new CultureInfo(Windows.System.UserProfile.GlobalizationPreferences.Languages[0]);
它基本上是基于他们喜欢的顶级语言(我认为是显示UI)创建CultureInfo


祝你好运:)

为什么那行不行?还有一个,它说它在WP 8.1中工作,它的工作原理类似于CultureInfo.CurrentUICulture.NameSo,你有答案吗?如果是这样,请使用下面的按钮进行自我回答(获得一些额外的代表)。CultureInfo.CurrentUICulture.Name.ToString()返回en-en,尽管我的操作系统是德语的??实际上不起作用。我的手机正在运行“de-de”,我切换到“de-CH”测试应用程序是否适应了货币符号和其他东西de CH'位于索引1上,尽管它是主要语言。我想微软已经设法使事情变得简单而困难。