How to determine the 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 don't all the obsolete things have good documentation, what can you use instead, as in xCode?

+5
source share
1 answer

CultureInfo.CurrentCulture is used to return region format settings. WP 8.1 seems to return the default locale to Package.appxmanifest.

It’s kind of sucks, right? :)

I think this is planned because they want to use GlobalizationPreferences instead. Therefore, to get back to what you want ... you need to do something like this:

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

Basically, he creates CultureInfo based on his preferred language (which, I think, is a display interface).

Good luck :)

+7
source

Source: https://habr.com/ru/post/1203299/


All Articles