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.
- Android - Device Language. Unity queries the Android getDefault value.
- System Culture. Unity uses the CultureInfo.CurrentUICulture value.
- System Language. Unity uses the SystemLanguage value as its final check.
Namespace: UnityEngine.Localization.Settings
Syntax
[Serializable]
public class SystemLocaleSelector : IStartupLocaleSelector
Methods
GetApplicationSystemLanguage()
Returns Application.systemLanguage.
Declaration
protected virtual SystemLanguage GetApplicationSystemLanguage()
Returns
Type | Description |
---|---|
SystemLanguage |
GetStartupLocale(ILocalesProvider)
Uses CultureInfo.CurrentUICulture and Application.systemLanguage to find a matching Locale from the available locales.
Declaration
public Locale GetStartupLocale(ILocalesProvider availableLocales)
Parameters
Type | Name | Description |
---|---|---|
ILocalesProvider | availableLocales |
Returns
Type | Description |
---|---|
Locale |
Implements
GetSystemCulture()
Returns CultureInfo.CurrentUICulture.
Declaration
protected virtual CultureInfo GetSystemCulture()
Returns
Type | Description |
---|---|
CultureInfo |