Forum Xamarin.iOS
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

CurrentUICulture on Mac

ThomasFlemmingThomasFlemming DEMember ✭✭
edited April 2018 in Xamarin.iOS

System.Globalization.CultureInfo.InstalledUICulture and also System.Threading.Thread.CurrentThread.CurrentUICulture always returns en-US with Xamarin.Mac. On Windows it returns the language the user configured in the system. How do I get users language setting with Mac?

Edit: its ok, must do it native, for example: https://stackoverflow.com/questions/1085506/how-to-get-language-locale-of-the-user-in-objective-c

Answers

  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    We get those (and some other settings from System.Environment) from the BCL. You want NSLocal.

  • YuriKuznetsovYuriKuznetsov USMember ✭✭✭
    edited April 2018
    var langCode = NSLocale.CurrentLocale.LanguageCode;
    
Sign In or Register to comment.