Struct LocaleIdentifier | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Struct LocaleIdentifier

    The identifier containing the identification information for a language or regional variant.

    Namespace: UnityEngine.Localization
    Syntax
    [Serializable]
    public struct LocaleIdentifier

    Constructors

    LocaleIdentifier(CultureInfo)

    Declaration
    public LocaleIdentifier(CultureInfo culture)
    Parameters
    Type Name Description
    System.Globalization.CultureInfo culture

    LocaleIdentifier(String)

    Declaration
    public LocaleIdentifier(string code)
    Parameters
    Type Name Description
    System.String code

    LocaleIdentifier(SystemLanguage)

    Declaration
    public LocaleIdentifier(SystemLanguage systemLanguage)
    Parameters
    Type Name Description
    SystemLanguage systemLanguage

    Properties

    Code

    The culture name in the format [language]-[region].

    Declaration
    public string Code { get; }
    Property Value
    Type Description
    System.String
    Remarks

    For example, Language English would be 'en', Regional English(UK) would be 'en-GB' and Regional English(US) would be 'en-US'.

    CultureInfo

    A CultureInfo representation of the Locale.

    Declaration
    public CultureInfo CultureInfo { get; }
    Property Value
    Type Description
    System.Globalization.CultureInfo
    Remarks

    The id is used to query for a CultureInfo unless its value is 0, in which case the Code will be used.

    Undefined

    Represents an undefined Local Identifier. One that does not define any language or region.

    Declaration
    public static LocaleIdentifier Undefined { get; }
    Property Value
    Type Description
    LocaleIdentifier

    Methods

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean
    Overrides
    System.ValueType.Equals(System.Object)

    Equals(LocaleIdentifier)

    Declaration
    public bool Equals(LocaleIdentifier other)
    Parameters
    Type Name Description
    LocaleIdentifier other
    Returns
    Type Description
    System.Boolean

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.ValueType.GetHashCode()

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String
    Overrides
    System.ValueType.ToString()

    Operators

    Equality(LocaleIdentifier, LocaleIdentifier)

    Declaration
    public static bool operator ==(LocaleIdentifier l1, LocaleIdentifier l2)
    Parameters
    Type Name Description
    LocaleIdentifier l1
    LocaleIdentifier l2
    Returns
    Type Description
    System.Boolean

    Implicit(CultureInfo to LocaleIdentifier)

    Declaration
    public static implicit operator LocaleIdentifier(CultureInfo culture)
    Parameters
    Type Name Description
    System.Globalization.CultureInfo culture
    Returns
    Type Description
    LocaleIdentifier

    Implicit(String to LocaleIdentifier)

    Declaration
    public static implicit operator LocaleIdentifier(string code)
    Parameters
    Type Name Description
    System.String code
    Returns
    Type Description
    LocaleIdentifier

    Implicit(SystemLanguage to LocaleIdentifier)

    Declaration
    public static implicit operator LocaleIdentifier(SystemLanguage systemLanguage)
    Parameters
    Type Name Description
    SystemLanguage systemLanguage
    Returns
    Type Description
    LocaleIdentifier

    Inequality(LocaleIdentifier, LocaleIdentifier)

    Declaration
    public static bool operator !=(LocaleIdentifier l1, LocaleIdentifier l2)
    Parameters
    Type Name Description
    LocaleIdentifier l1
    LocaleIdentifier l2
    Returns
    Type Description
    System.Boolean
    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