feat: localize dashboard shell
This commit is contained in:
@@ -2,6 +2,8 @@ import { DashboardShell } from "@/components/layout/dashboard-shell";
|
||||
import { domainActorFromSession } from "@/server/auth/domain-actor";
|
||||
import { requireFreelancer } from "@/server/auth/session";
|
||||
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";
|
||||
|
||||
export default async function DashboardLayout({
|
||||
@@ -13,6 +15,23 @@ export default async function DashboardLayout({
|
||||
const { user, profile } = context;
|
||||
const branding = getPublicBranding();
|
||||
const preferences = getUserPreferences(domainActorFromSession(context));
|
||||
const resolvedLocale = await resolveRequestLocale();
|
||||
const translator = createTranslator(resolvedLocale.locale, [
|
||||
"common",
|
||||
"navigation",
|
||||
"dashboard",
|
||||
"clients",
|
||||
"projects",
|
||||
"tasks",
|
||||
"calendar",
|
||||
"finance",
|
||||
"journal",
|
||||
"chat",
|
||||
"settings",
|
||||
"status",
|
||||
"validation",
|
||||
]);
|
||||
const t = translator.t;
|
||||
const displayName = profile.displayName || user.name || user.email.split("@")[0] || "Neta Kullanıcısı";
|
||||
|
||||
const shortName =
|
||||
@@ -33,6 +52,36 @@ export default async function DashboardLayout({
|
||||
darkLogoUrl: branding.darkLogoUrl,
|
||||
}}
|
||||
colorMode={preferences.colorMode}
|
||||
i18n={getClientI18nPayload(resolvedLocale.locale, [
|
||||
"common",
|
||||
"navigation",
|
||||
"dashboard",
|
||||
"clients",
|
||||
"projects",
|
||||
"tasks",
|
||||
"calendar",
|
||||
"finance",
|
||||
"journal",
|
||||
"chat",
|
||||
"settings",
|
||||
"status",
|
||||
"validation",
|
||||
])}
|
||||
labels={{
|
||||
skipToContent: t("navigation.shell.skipToContent"),
|
||||
homeAriaLabel: t("navigation.shell.homeAriaLabel", { app: branding.applicationName }),
|
||||
mobileMenuAriaLabel: t("navigation.shell.mobileMenuAriaLabel"),
|
||||
mobileMenuTooltip: t("navigation.shell.mobileMenuTooltip"),
|
||||
logoAlt: t("navigation.shell.logoAlt", { app: branding.applicationName }),
|
||||
progressTitle: t("navigation.shell.progressTitle"),
|
||||
progressValue: t("navigation.shell.progressValue"),
|
||||
progressAriaLabel: t("navigation.shell.progressAriaLabel"),
|
||||
accountMenuAriaLabel: t("navigation.shell.accountMenuAriaLabel"),
|
||||
settings: t("navigation.items.settings"),
|
||||
signOut: t("navigation.account.signOut"),
|
||||
signingOut: t("navigation.account.signingOut"),
|
||||
signOutError: t("navigation.account.signOutError"),
|
||||
}}
|
||||
user={{
|
||||
email: user.email,
|
||||
displayName,
|
||||
|
||||
Reference in New Issue
Block a user