feat: persist portal invitation locales

This commit is contained in:
poyrazavsever
2026-07-19 03:07:35 +03:00
parent c1c473469a
commit 0158f2f25a
10 changed files with 249 additions and 46 deletions
+20
View File
@@ -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>