Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Commit dd86295

Browse files
committed
fix: move assignment to state
1 parent a82f81d commit dd86295

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/packages/core/localization/registry/localization.registry.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function addOrUpdateDictionary(
2222
}
2323

2424
export class UmbLocalizationRegistry {
25-
#currentLanguage = new UmbStringState(document.documentElement.lang ?? 'en-us');
25+
#currentLanguage = new UmbStringState(document.documentElement.lang !== '' ? document.documentElement.lang : UMB_DEFAULT_LOCALIZATION_CULTURE);
2626
readonly currentLanguage = this.#currentLanguage.asObservable();
2727

2828
#loadedExtAliases: Array<string> = [];
@@ -37,7 +37,7 @@ export class UmbLocalizationRegistry {
3737
constructor(extensionRegistry: UmbBackofficeExtensionRegistry) {
3838
combineLatest([this.currentLanguage, extensionRegistry.byType('localization')]).subscribe(
3939
async ([currentLanguage, extensions]) => {
40-
const locale = new Intl.Locale(currentLanguage ? currentLanguage : UMB_DEFAULT_LOCALIZATION_CULTURE);
40+
const locale = new Intl.Locale(currentLanguage);
4141
const filteredExt = extensions.filter(
4242
(ext) =>
4343
ext.meta.culture.toLowerCase() === locale.baseName.toLowerCase() ||

0 commit comments

Comments
 (0)