Class Locale | Localization | 0.9.0-preview
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 via metadata.

    Inheritance
    Object
    Object
    ScriptableObject
    Locale
    PseudoLocale
    Inherited Members
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(String)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(Object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, Boolean)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, Boolean)
    Object.Destroy(Object, Single)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, Boolean)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, Single)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectOfType<T>()
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.name
    Object.hideFlags
    Namespace: UnityEngine.Localization
    Syntax
    public class Locale : ScriptableObject, IComparable<Locale>

    Properties

    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

    Metadata

    Optional Metadata. It is possible to attach additional data to the Locale providing it implements the IMetadata interface and is serializable.

    Declaration
    public MetadataCollection Metadata { get; set; }
    Property Value
    Type Description
    MetadataCollection

    SortOrder

    The sort order can be used to override the order of Locales when sorted in a list. If Locales both have the same SortOrder then they will be sorted by name.

    Declaration
    public ushort SortOrder { get; set; }
    Property Value
    Type Description
    UInt16

    Methods

    CompareTo(Locale)

    Compares the Locales properties.

    Declaration
    public int CompareTo(Locale other)
    Parameters
    Type Name Description
    Locale other
    Returns
    Type Description
    Int32

    CreateLocale(CultureInfo)

    Create a Locale using a CultureInfo.

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

    CreateLocale(String)

    Create a new Locale using the culture code.

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

    Culture code.

    Returns
    Type Description
    Locale

    CreateLocale(LocaleIdentifier)

    Create a new Locale using the provided LocaleIdentifier.

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

    CreateLocale(SystemLanguage)

    Create a Locale using the system language enum value.

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

    ToString()

    Returns

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