Search Results for

    Show / Hide Table of Contents

    Struct Locale

    A Locale is a language or a language plus a region. To learn more read the related documentation page from For example:

    • en-US is the locale for the version of English language that is spoken in the United States (US).
    • en-GB is the locale for the version of English language that is spoken in the United Kingdom (UK).
    Implements
    IEquatable<Locale>
    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    Namespace: NoSuchStudio.Localization
    Assembly: NoSuchStudio-Localization.dll
    Syntax
    [Serializable]
    [JsonObject(MemberSerialization.OptIn)]
    public struct Locale : IEquatable<Locale>

    Fields

    EmptyLocale

    Declaration
    public static readonly Locale EmptyLocale
    Field Value
    Type Description
    Locale

    Properties

    EnglishName

    English name of the locale.

    Declaration
    public string EnglishName { get; }
    Property Value
    Type Description
    String

    IsNeutral

    Declaration
    public bool IsNeutral { get; }
    Property Value
    Type Description
    Boolean

    ISO

    ISO language code for the locale (is not unique).

    Declaration
    public string ISO { get; }
    Property Value
    Type Description
    String

    IsRTL

    Whether the locale is right-to-left.

    Declaration
    public bool IsRTL { get; }
    Property Value
    Type Description
    Boolean

    LanguageInName

    Get the language portion of the code name. For United States English (en-US), English (en) will be returned.

    Declaration
    public string LanguageInName { get; }
    Property Value
    Type Description
    String

    Name

    Code name of the locale.

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    String

    NativeName

    Native name of the locale.

    Declaration
    public string NativeName { get; }
    Property Value
    Type Description
    String

    NormalizedEnglishName

    Unique normalized english name of the locale. Suitable for keys of a dictionary.

    Declaration
    public string NormalizedEnglishName { get; }
    Property Value
    Type Description
    String

    NormalizedName

    Get the normalized name of the locale. It is the suggested form to get a unique name for a locale (e.g. for use as keys in a dictionary)

    Declaration
    public string NormalizedName { get; }
    Property Value
    Type Description
    String

    Parent

    Declaration
    public string Parent { get; }
    Property Value
    Type Description
    String

    RegionInEnglishName

    Get the language portion of the english name. For "English (United States)", "United States" will be returned.

    Declaration
    public string RegionInEnglishName { get; }
    Property Value
    Type Description
    String

    RegionInName

    Get the language portion of the code name. For United States English (en-US), United States (US) will be returned.

    Declaration
    public string RegionInName { get; }
    Property Value
    Type Description
    String

    Methods

    Equals(Locale)

    Declaration
    public bool Equals(Locale other)
    Parameters
    Type Name Description
    Locale other
    Returns
    Type Description
    Boolean

    LanguageInLocaleName(String)

    For United States English locale (en-US), returns en.

    Declaration
    public static string LanguageInLocaleName(string name)
    Parameters
    Type Name Description
    String name

    name of locale e.g. en-US

    Returns
    Type Description
    String

    the language section of a locale name.

    NormalizeLocaleName(String)

    Maps locale name to a canonical version to be used as keys for dictionaries.

    Declaration
    public static string NormalizeLocaleName(string localeName)
    Parameters
    Type Name Description
    String localeName
    Returns
    Type Description
    String

    RegionInLocaleName(String)

    For United States English locale (en-US), returns US.

    Declaration
    public static string RegionInLocaleName(string name)
    Parameters
    Type Name Description
    String name

    name of locale e.g. en-US

    Returns
    Type Description
    String

    the region section of a locale name.

    ToDebugString()

    Declaration
    public string ToDebugString()
    Returns
    Type Description
    String

    ToString()

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

    Operators

    Implicit(Locale to String)

    Declaration
    public static implicit operator string (Locale l)
    Parameters
    Type Name Description
    Locale l
    Returns
    Type Description
    String

    Implicit(String to Locale)

    Declaration
    public static implicit operator Locale(string str)
    Parameters
    Type Name Description
    String str
    Returns
    Type Description
    Locale

    Implements

    System.IEquatable<T>
    In This Article
    Back to top Generated by DocFX