add comments and requirements for language

This commit is contained in:
Jacob Overgaard
2023-08-02 15:11:54 +02:00
parent bd10d0492a
commit a5802fdce6

View File

@@ -57,8 +57,13 @@ export class UmbTranslationRegistry {
);
}
loadLanguage(userCulture: string) {
this.#currentLanguage.next(userCulture.toLowerCase());
/**
* Load a language from the extension registry.
* @param locale The locale to load.
*/
loadLanguage(locale: Intl.BCP47LanguageTag | Intl.Locale) {
locale = new Intl.Locale(locale);
this.#currentLanguage.next(`${locale.language}-${locale.region}`.toLowerCase());
}
#addOrUpdateDictionary(