import { getTranslations } from "next-intl/server"; import type { WindowLabels } from "./types"; /** Alle Texte für Fenster und Sheets, serverseitig geladen und als Props weitergereicht. */ export async function getWindowLabels(locale: string): Promise { const t = await getTranslations({ locale, namespace: "home.windows" }); const tisch = await getTranslations({ locale, namespace: "home.tisch" }); return { close: t("close"), minimize: t("minimize"), openWindows: t("openWindows"), projectPage: t("projectPage"), source: t("source"), live: t("live"), stack: t("stack"), year: t("year"), now: { title: t("now.title"), days: t("now.days"), rows: (["study", "work", "side"] as const).map((k) => ({ label: t(`now.${k}.label`), text: t(`now.${k}.text`) })), }, server: { title: t("server.title"), headline: t("server.headline"), rows: (["ingress", "mail", "home"] as const).map((k) => ({ name: tisch(`servers.${k}.name`), detail: tisch(`servers.${k}.detail`), })), note: tisch("serverNote"), }, read: { title: t("read.title"), progress: t("read.progress"), empty: t("read.empty"), library: t("read.library"), libraryHref: `/${locale}/books`, }, about: { title: t("about.title"), paragraphs: [t("about.p1"), t("about.p2")], facts: (["laptop", "pc", "study", "languages"] as const).map((k) => ({ label: t(`about.facts.${k}.label`), value: t(`about.facts.${k}.value`), })), }, chat: { title: t("chat.title"), welcome: t("chat.welcome"), consent: t("chat.consent"), allow: t("chat.allow"), placeholder: t("chat.placeholder"), send: t("chat.send"), error: t("chat.error"), thinking: t("chat.thinking"), note: t("chat.note"), }, contact: { title: t("contact.title"), body: t("contact.body"), copy: t("contact.copy"), copied: t("contact.copied"), form: t("contact.form"), }, }; }