v.g.
v.g.

Reputation: 1076

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?

Upvotes: 5

Views: 3278

Answers (1)

Chubosaurus Software
Chubosaurus Software

Reputation: 8161

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

Upvotes: 8

Related Questions