diff --git a/apps/browser/src/auth/popup/extension-anon-layout-wrapper/extension-anon-layout-wrapper.component.ts b/apps/browser/src/auth/popup/extension-anon-layout-wrapper/extension-anon-layout-wrapper.component.ts index df6e313342b..a16ca5862cf 100644 --- a/apps/browser/src/auth/popup/extension-anon-layout-wrapper/extension-anon-layout-wrapper.component.ts +++ b/apps/browser/src/auth/popup/extension-anon-layout-wrapper/extension-anon-layout-wrapper.component.ts @@ -149,7 +149,15 @@ export class ExtensionAnonLayoutWrapperComponent implements OnInit, OnDestroy { } if (data.pageSubtitle) { - this.pageSubtitle = this.i18nService.t(data.pageSubtitle); + // If you pass just a string, we translate it by default + if (typeof data.pageSubtitle === "string") { + this.pageSubtitle = this.i18nService.t(data.pageSubtitle); + } else { + // if you pass an object, you can specify if you want to translate it or not + this.pageSubtitle = data.pageSubtitle.translate + ? this.i18nService.t(data.pageSubtitle.subtitle) + : data.pageSubtitle.subtitle; + } } if (data.pageIcon) { diff --git a/libs/auth/src/angular/anon-layout/anon-layout-wrapper.component.ts b/libs/auth/src/angular/anon-layout/anon-layout-wrapper.component.ts index 1c082323b1d..a71f9101c93 100644 --- a/libs/auth/src/angular/anon-layout/anon-layout-wrapper.component.ts +++ b/libs/auth/src/angular/anon-layout/anon-layout-wrapper.component.ts @@ -10,7 +10,12 @@ import { AnonLayoutWrapperDataService } from "./anon-layout-wrapper-data.service export interface AnonLayoutWrapperData { pageTitle?: string; - pageSubtitle?: string; + pageSubtitle?: + | string + | { + subtitle: string; + translate: boolean; + }; pageIcon?: Icon; showReadonlyHostname?: boolean; maxWidth?: "md" | "3xl"; @@ -99,7 +104,15 @@ export class AnonLayoutWrapperComponent implements OnInit, OnDestroy { } if (data.pageSubtitle) { - this.pageSubtitle = this.i18nService.t(data.pageSubtitle); + // If you pass just a string, we translate it by default + if (typeof data.pageSubtitle === "string") { + this.pageSubtitle = this.i18nService.t(data.pageSubtitle); + } else { + // if you pass an object, you can specify if you want to translate it or not + this.pageSubtitle = data.pageSubtitle.translate + ? this.i18nService.t(data.pageSubtitle.subtitle) + : data.pageSubtitle.subtitle; + } } if (data.pageIcon) { diff --git a/libs/auth/src/angular/anon-layout/anon-layout-wrapper.stories.ts b/libs/auth/src/angular/anon-layout/anon-layout-wrapper.stories.ts index 80fabe40612..7e6fda54a82 100644 --- a/libs/auth/src/angular/anon-layout/anon-layout-wrapper.stories.ts +++ b/libs/auth/src/angular/anon-layout/anon-layout-wrapper.stories.ts @@ -177,7 +177,10 @@ const initialData: AnonLayoutWrapperData = { const changedData: AnonLayoutWrapperData = { pageTitle: "enterpriseSingleSignOn", - pageSubtitle: "checkYourEmail", + pageSubtitle: { + subtitle: "user@email.com (non-translated)", + translate: false, + }, pageIcon: RegistrationCheckEmailIcon, };