Class Localization
The language and culture localization manager.
Inheritance
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public static class Localization : Object
Properties
CurrentCulture
Gets or sets the current culture (date, time, currency and values formatting locale).
Declaration
[Unmanaged]
public static CultureInfo CurrentCulture { get; set; }
Property Value
System.Globalization.CultureInfo
|
CurrentLanguage
Gets or sets the current language (text display locale).
Declaration
[Unmanaged]
public static CultureInfo CurrentLanguage { get; set; }
Property Value
System.Globalization.CultureInfo
|
Methods
GetPluralString(String, Int32, String)
Gets the localized plural string for the current language by using string id lookup.
Declaration
[Unmanaged]
public static string GetPluralString(string id, int n, string fallback = null)
Parameters
System.String
id
The message identifier. |
System.Int32
n
The value count for plural message selection. |
System.String
fallback
The optional fallback string value to use if localized string is missing. |
Returns
System.String
The localized text. |
GetString(String, String)
Gets the localized string for the current language by using string id lookup.
Declaration
[Unmanaged]
public static string GetString(string id, string fallback = null)
Parameters
System.String
id
The message identifier. |
System.String
fallback
The optional fallback string value to use if localized string is missing. |
Returns
System.String
The localized text. |
NewCulture(String)
Creates new culture.
Declaration
public static CultureInfo NewCulture(string name)
Parameters
System.String
name
The name (eg. en, pl-PL). |
Returns
System.Globalization.CultureInfo
The culture. |
SetCurrentLanguageCulture(CultureInfo)
Sets both the current language (text display locale) and the current culture (date, time, currency and values formatting locale) at once.
Declaration
[Unmanaged]
public static void SetCurrentLanguageCulture(CultureInfo value)
Parameters
System.Globalization.CultureInfo
value
|
Events
LocalizationChanged
Occurs when current culture or language gets changed. Can be used to refresh UI to reflect language changes.
Declaration
[Unmanaged]
public static event Action LocalizationChanged
Event Type
System.Action
|