Skip to content

L10n

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

public readonly struct L10n

Inheritance Object → ValueType → L10n

public static L10n Empty

L10n

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> GetI18n

Func<I18n>

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> GetPreferredLanguage

Func<String>

public L10n(string key)

key String

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

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)

lang String

text String&

Boolean

public override string ToString()

String