feat: persist portal invitation locales
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { PortalShell } from "@/components/layout/portal-shell";
|
||||
import { getPublicBranding } from "@/server/branding/runtime";
|
||||
import { resolveRequestLocale } from "@/server/i18n/resolver";
|
||||
import { createTranslator, getClientI18nPayload } from "@/server/i18n/translator";
|
||||
import { getUserPreferences } from "@/server/settings/preferences";
|
||||
import { requirePortalBackend } from "@/server/web/portal";
|
||||
|
||||
@@ -9,6 +11,8 @@ export default async function PortalLayout({
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
const { context, actor, service } = await requirePortalBackend();
|
||||
const resolvedLocale = await resolveRequestLocale();
|
||||
const t = createTranslator(resolvedLocale.locale, ["navigation", "portal", "common"]).t;
|
||||
const { user, profile } = context;
|
||||
const branding = getPublicBranding();
|
||||
const preferences = getUserPreferences(actor);
|
||||
@@ -43,6 +47,22 @@ export default async function PortalLayout({
|
||||
avatarUrl: user.image || null,
|
||||
}}
|
||||
progress={progress}
|
||||
i18n={getClientI18nPayload(resolvedLocale.locale, ["navigation", "portal", "common", "status", "validation"])}
|
||||
labels={{
|
||||
skipToContent: t("navigation.shell.skipToContent"),
|
||||
homeAriaLabel: t("navigation.shell.homeAriaLabel", { app: branding.organizationName ?? branding.applicationName }),
|
||||
mobileMenuAriaLabel: t("navigation.shell.mobileMenuAriaLabel"),
|
||||
mobileMenuTooltip: t("navigation.shell.mobileMenuTooltip"),
|
||||
logoAlt: t("navigation.shell.logoAlt", { app: branding.organizationName ?? branding.applicationName }),
|
||||
progressTitle: t("navigation.shell.progressTitle"),
|
||||
progressValue: t("navigation.shell.progressValue", { progress }),
|
||||
progressAriaLabel: t("navigation.shell.progressAriaLabel"),
|
||||
accountMenuAriaLabel: t("navigation.shell.accountMenuAriaLabel", { name: displayName }),
|
||||
signOut: t("navigation.account.signOut"),
|
||||
signingOut: t("navigation.account.signingOut"),
|
||||
signOutError: t("navigation.account.signOutError"),
|
||||
settings: t("navigation.items.settings"),
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</PortalShell>
|
||||
|
||||
Reference in New Issue
Block a user