Skip to content

L10n

A localization key that resolves to translated text via the active I18n instance.

public readonly struct L10n

Inheritance ObjectValueTypeL10n

public static L10n Empty

L10n

Returns the active I18n instance. It must be set before calling L10n.GetText or L10n.Text.

public static Func<I18n>? GetI18n

Func<I18n>

Returns the player’s current language tag. It must be set before calling L10n.Text.

public static Func<string>? GetPreferredLanguage

Func<String>

public L10n(string key)

key String

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; }

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)

lang String

text String&
The translated text, or null if not found.

Boolean

public override string ToString()

String