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).
Assembly: NoSuchStudio-Localization.dll
Syntax
[Serializable]
[JsonObject(MemberSerialization.OptIn)]
public struct Locale : IEquatable<Locale>
Fields
EmptyLocale
Declaration
public static readonly Locale EmptyLocale
Field Value
Properties
EnglishName
English name of the locale.
Declaration
public string EnglishName { get; }
Property Value
IsNeutral
Declaration
public bool IsNeutral { get; }
Property Value
ISO
ISO language code for the locale (is not unique).
Declaration
public string ISO { get; }
Property Value
IsRTL
Whether the locale is right-to-left.
Declaration
public bool IsRTL { get; }
Property Value
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
Name
Declaration
public string Name { get; }
Property Value
NativeName
Native name of the locale.
Declaration
public string NativeName { get; }
Property Value
NormalizedEnglishName
Unique normalized english name of the locale. Suitable for keys of a dictionary.
Declaration
public string NormalizedEnglishName { get; }
Property Value
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
Parent
Declaration
public string Parent { get; }
Property Value
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
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
Methods
Equals(Locale)
Declaration
public bool Equals(Locale other)
Parameters
| Type |
Name |
Description |
| Locale |
other |
|
Returns
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
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
ToString()
Declaration
public override string ToString()
Returns
Overrides
Operators
Implicit(Locale to String)
Declaration
public static implicit operator string (Locale l)
Parameters
| Type |
Name |
Description |
| Locale |
l |
|
Returns
Implicit(String to Locale)
Declaration
public static implicit operator Locale(string str)
Parameters
| Type |
Name |
Description |
| String |
str |
|
Returns
Implements