How to get Windows Phone system language from code?

Solution: Use CultureInfo.CurrentUICulture

The user can change the system language of Windows Phone at: Settings> language + region> Phone language

How can I get the selected language (phone language) from C # code?

Below are the settings of my phone:

A0WxD.jpg

Here is my code snippet:

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 ); 

Here is the result:

 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 

I can not find "Phone language"

+4
source share
2 answers

Use System.Threading.Thread.CurrentThread.CurrentCulture . It should correctly reflect the language of the phone.

+6
source

you can check my answer, this will help you change the language at runtime: fooobar.com/questions/443351 / ...

0
source

All Articles