mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-11 10:10:25 +01:00
PM-9603 - AnonLayout Dynamic Content Support - Add ability to avoid translating subtitle as we have designs where a user's email needs to go in the subtitle slot. (#10459)
This commit is contained in:
parent
cbe7ae68cc
commit
46ecde5d63
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user