Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect OS language in Windows Phone 8.1

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?

like image 771
v.g. Avatar asked Sep 24 '14 13:09

v.g.


People also ask

Do Windows 8.1 phones still work?

Your Windows Phone 8.1 device should continue to work after July 11, 2017, but there will be no updates after July 11, 2017 (including security updates) and device backup functionality and other backend services will be phased out as described above.


1 Answers

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

like image 195
Chubosaurus Software Avatar answered Oct 21 '22 07:10

Chubosaurus Software