SystemLanguageConverter.GetSystemLanguageCultureCode

Any chance you could make SystemLanguageConverter.GetSystemLanguageCultureCode public?

I was looking how to retrieve the system language and how to map it to a Locale. Using SystemLanguage and then converting it to a two-letter code seems like the simplest solution and that’s what the method in question is doing already. However, the method is marked as internal.

You can assign a SystemLanguage to a LocaleIdentifier which will run that code for you.

E.g
LocaleIdentifier li = SystemLanguage.English.
Print(li.Code)

https://docs.unity3d.com/Packages/com.unity.localization@0.10/api/UnityEngine.Localization.LocaleIdentifier.html

1 Like

That’s even more useful, thanks!

1 Like