docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    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. The System Locale Selector queries different APIs until it finds a 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.
    Inheritance
    object
    SystemLocaleSelector
    Implements
    IStartupLocaleSelector
    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.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)