diff --git a/src/Umbraco.Web.UI.Client/src/packages/users/current-user/modals/current-user/current-user-modal.element.ts b/src/Umbraco.Web.UI.Client/src/packages/users/current-user/modals/current-user/current-user-modal.element.ts index 660641e7f2..9f2722005a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/users/current-user/modals/current-user/current-user-modal.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/users/current-user/modals/current-user/current-user-modal.element.ts @@ -1,3 +1,4 @@ +import { UMB_LOCALIZATION_CONTEXT } from '@umbraco-cms/backoffice/localization-api'; import { UMB_AUTH, type UmbLoggedInUser } from '@umbraco-cms/backoffice/auth'; import { UMB_APP } from '@umbraco-cms/backoffice/context'; import { UUITextStyles } from '@umbraco-cms/backoffice/external/uui'; @@ -10,6 +11,12 @@ export class UmbCurrentUserModalElement extends UmbLitElement { @property({ attribute: false }) modalContext?: UmbModalContext; + @state() + protected labelClose = 'Close'; + + @state() + protected labelLogout = 'Log out'; + @state() private _currentUser?: UmbLoggedInUser; @@ -25,15 +32,16 @@ export class UmbCurrentUserModalElement extends UmbLitElement { this._observeCurrentUser(); }); - this.consumeContext(UMB_AUTH, (instance) => { - this.#auth = instance; - }); - this.consumeContext(UMB_APP, (instance) => { this.#appContext = instance; }); - this._observeCurrentUser(); + this.consumeContext(UMB_LOCALIZATION_CONTEXT, (instance) => { + instance.localizeMany(['general_close', 'general_logout']).subscribe((values) => { + if (values['general_close']) this.labelClose = values['general_close']; + if (values['general_logout']) this.labelLogout = values['general_logout']; + }); + }); } private async _observeCurrentUser() { @@ -64,10 +72,10 @@ export class UmbCurrentUserModalElement extends UmbLitElement {
- + Close - + Log out