Class Locale | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class Locale

    A Locale represents a language. It supports regional variations and can be configured with an optional fallback locale.

    Inheritance
    System.Object
    Locale
    Namespace: UnityEngine.Localization
    Syntax
    public class Locale : ScriptableObject

    Properties

    FallbackLocale

    An optional fallback locale can be configured to link Locales that may serve as good alternatives when no localization data is available for the current locale.

    Declaration
    public Locale FallbackLocale { get; set; }
    Property Value
    Type Description
    Locale
    Remarks

    For example, regional variations could be configured for some specific words such as when the selected Locale is English(UK), then the word Color could be localized to ‘Colour’ however other words would fall back from English(UK) to English(US). Note: The fallback locale must be added to the active LocalizationSettings or it will not be possible to retrieve it.

    Identifier

    The identifier contains the identifying information such as the id and culture Code for this Locale.

    Declaration
    public LocaleIdentifier Identifier { get; set; }
    Property Value
    Type Description
    LocaleIdentifier

    Methods

    CreateLocale(CultureInfo)

    Declaration
    public static Locale CreateLocale(CultureInfo cultureInfo)
    Parameters
    Type Name Description
    System.Globalization.CultureInfo cultureInfo
    Returns
    Type Description
    Locale

    CreateLocale(String)

    Declaration
    public static Locale CreateLocale(string code)
    Parameters
    Type Name Description
    System.String code
    Returns
    Type Description
    Locale

    CreateLocale(SystemLanguage)

    Declaration
    public static Locale CreateLocale(SystemLanguage language)
    Parameters
    Type Name Description
    SystemLanguage language
    Returns
    Type Description
    Locale

    CreateLocale(LocaleIdentifier)

    Declaration
    public static Locale CreateLocale(LocaleIdentifier identifier)
    Parameters
    Type Name Description
    LocaleIdentifier identifier
    Returns
    Type Description
    Locale

    OnEnable()

    Declaration
    protected virtual void OnEnable()

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String
    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