From 7c6fda21bdbaf8a0851ebfa409638eb07bd97d0e Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Fri, 11 Aug 2023 10:51:34 +0200 Subject: [PATCH] load the initial language first from the 'lang' attribute, then from the document, and lastly default 'en-us' --- .../src/apps/app/app.element.ts | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/apps/app/app.element.ts b/src/Umbraco.Web.UI.Client/src/apps/app/app.element.ts index c304290c78..651f71c9aa 100644 --- a/src/Umbraco.Web.UI.Client/src/apps/app/app.element.ts +++ b/src/Umbraco.Web.UI.Client/src/apps/app/app.element.ts @@ -23,19 +23,6 @@ export class UmbAppElement extends UmbLitElement { @property({ type: String }) serverUrl = window.location.origin; - /** - * The default culture to use for localization. - * - * When the current user is resolved, the culture will be set to the user's culture. - * - * @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: string = 'en-us'; - /** * The base path of the backoffice. * @@ -89,7 +76,8 @@ export class UmbAppElement extends UmbLitElement { } #setLanguage() { - umbTranslationRegistry.loadLanguage(this.culture); + const initialLanguage = this.lang || document.documentElement.lang || 'en-us'; + umbTranslationRegistry.loadLanguage(initialLanguage); } #listenForLanguageChange(authContext: UmbAuthContext) {