Class LanguagePrefs
- Namespace
- nadena.dev.ndmf.localization
Tracks the currently selected UI language
public static class LanguagePrefs
- Inheritance
-
LanguagePrefs
- Inherited Members
Properties
Language
The currently selected language ID, e.g. "en-us".
public static string Language { get; set; }
Property Value
RegisteredLanguages
Returns a list of all languages which have been registered at some point with the localization system.
public static ImmutableSortedSet<string> RegisteredLanguages { get; }
Property Value
Methods
ApplyFontPreferences(VisualElement)
Arranges to set the inheritable font style for a given visual element to the NDMF-bundled font for this language, if any.
public static void ApplyFontPreferences(VisualElement elem)
Parameters
elem
VisualElement
RegisterLanguage(string)
Registers an additional language code to display in the language selectors.
public static void RegisterLanguage(string languageCode)
Parameters
languageCode
string
RegisterLanguageChangeCallback<T>(T, Action<T>)
Registers a callback to be invoked when the currently selected language changes.
This callback will be retained as long as the handle
object is not garbage collected.
public static void RegisterLanguageChangeCallback<T>(T handle, Action<T> callback) where T : class
Parameters
handle
TAn object which controls the lifetime of callback.
callback
Action<T>A callback to be invoked, passing the value of handle
Type Parameters
T