docs.unity3d.com
    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.
    • 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.

    Inheritance
    Object
    SystemLocaleSelector
    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
    IStartupLocaleSelector.GetStartupLocale(ILocalesProvider)

    GetSystemCulture()

    Returns CultureInfo.CurrentUICulture.

    Declaration
    protected virtual CultureInfo GetSystemCulture()
    Returns
    Type Description
    CultureInfo
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023