Class SystemLocaleSelector
Attempts to detect the locale of the device and find a match. The System Locale Selector queries different APIs until it finds a matching locale or a suitable fallback locale.
- iOS - Preferred Language. Unity queries the [iOS Preferred Language](https://developer.apple.com/news/?id=u2cfuj88).
- Android - Device Language. Unity queries the [Android getDefault](https://developer.android.com/reference/java/util/Locale#getDefault(java.util.Locale.Category)) value.
- System Culture. Unity uses the [CultureInfo.CurrentUICulture](https://docs.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo.currentuiculture) value.
- System Language. Unity uses the [SystemLanguage](https://docs.unity3d.com/ScriptReference/SystemLanguage.html) value as its final check.
Implements
Namespace: UnityEngine.Localization.Settings
Assembly: Unity.Localization.dll
Syntax
[Serializable]
public class SystemLocaleSelector : IStartupLocaleSelector
Methods
Name | Description |
---|---|
GetApplicationSystemLanguage() | Returns Application.systemLanguage. |
GetStartupLocale(ILocalesProvider) | Uses CultureInfo.CurrentUICulture and Application.systemLanguage to find a matching Locale from the available locales. |
GetSystemCulture() | Returns CultureInfo.CurrentUICulture. |