Class Locale | Localization | 0.5.1-preview
docs.unity.cn
    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
    Locale
    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

    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(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

    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

    ToString()

    Returns

    Declaration
    public override string ToString()
    Returns
    Type Description
    String
    Back to top Copyright © 2019 Unity Technologies
    Generated by DocFX