go back to strings to accept arbitrary culture codes

This commit is contained in:
Jacob Overgaard
2023-08-02 15:24:38 +02:00
parent 3752582ffa
commit a0dd36a91d
2 changed files with 5 additions and 4 deletions

View File

@@ -30,9 +30,11 @@ export class UmbAppElement extends UmbLitElement {
*
* @attr
* @remarks This is the default culture to use for localization, not the current culture.
* @example "en-us"
* @example "en"
*/
@property({ type: String, attribute: 'default-culture' })
culture: Intl.BCP47LanguageTag | Intl.Locale = 'en-us';
culture: string = 'en-us';
/**
* The base path of the backoffice.

View File

@@ -62,9 +62,8 @@ export class UmbTranslationRegistry {
* 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());
loadLanguage(locale: string) {
this.#currentLanguage.next(locale.toLowerCase());
}
#addOrUpdateDictionary(