Class Locale
A Locale represents a language. It supports regional variations and can be configured with an optional fallback Locale via metadata.
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
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
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
Methods
CompareTo(Locale)
Compares the Locales properties.
Declaration
public int CompareTo(Locale other)
Parameters
Type |
Name |
Description |
Locale |
other |
|
Returns
CreateLocale(CultureInfo)
Create a Locale using a CultureInfo.
Declaration
public static Locale CreateLocale(CultureInfo cultureInfo)
Parameters
Returns
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
CreateLocale(LocaleIdentifier)
Declaration
public static Locale CreateLocale(LocaleIdentifier identifier)
Parameters
Returns
CreateLocale(SystemLanguage)
Create a Locale using the system language enum value.
Declaration
public static Locale CreateLocale(SystemLanguage language)
Parameters
Returns
ToString()
Declaration
public override string ToString()
Returns
Overrides