For UWP there are some changes in the CultureInfo according to the blog entry CultureInfo changes in UWP. Can I take GlobalizationPreferences to get the CultureInfo
correctly?
public CultureInfo GetCurrentCultureInfo()
{
return new CultureInfo(Windows.System.UserProfile.GlobalizationPreferences.Languages[0].ToString());
}
Taken from this example.
Can I take GlobalizationPreferences to get the CultureInfo correctly?
Yes you can, I've tested your method, it works well by my side.
I want to know the current language of the device (not region).
You can also use Windows.Globalization.Language.CurrentInputMethodLanguageTag to get the current enabled keyboard layout or Input.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With