L10n
A localization key that resolves to translated text via the active I18n instance.
public readonly struct L10nInheritance Object → ValueType → L10n
Fields
Section titled “Fields”public static L10n EmptyField Value
Section titled “Field Value”GetI18n
Section titled “GetI18n”Returns the active I18n instance used by L10n. This is a global setting and must be set before calling L10n.GetText or L10n.Text.
public static Func<I18n> GetI18nField Value
Section titled “Field Value”GetPreferredLanguage
Section titled “GetPreferredLanguage”Returns the player’s preferred language code used by L10n. This is a global setting and must be set before calling L10n.Text.
public static Func<string> GetPreferredLanguageField Value
Section titled “Field Value”Constructors
Section titled “Constructors”L10n(String)
Section titled “L10n(String)”public L10n(string key)Parameters
Section titled “Parameters”key String
Properties
Section titled “Properties”Returns the translation in the player’s preferred language, falling back to the default language if no translation is found, and finally to the key string if neither language has a translation.
public string Text { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”GetText(String, String&)
Section titled “GetText(String, String&)”Returns true on success, with the translated text in text; otherwise false. An empty key succeeds with an empty string.
public bool GetText(string lang, String& text)Parameters
Section titled “Parameters”lang String
text String&
Returns
Section titled “Returns”ToString()
Section titled “ToString()”public override string ToString()