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. It 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 current language tag. It 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 for the player’s preferred language, falling back to the default language if the key isn’t found.
public string Text { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”GetText(String, String&)
Section titled “GetText(String, String&)”Returns the translation for the given language. Returns true if the key is found, with the translated text in text; otherwise false.
public bool GetText(string lang, String& text)Parameters
Section titled “Parameters”lang String
text String&
The translated text, or null if not found.
Returns
Section titled “Returns”ToString()
Section titled “ToString()”public override string ToString()