19 lines
598 B
TypeScript
19 lines
598 B
TypeScript
import fs from "node:fs/promises";
|
|
import path from "node:path";
|
|
import { TranslationsClient } from "../translations-client";
|
|
|
|
const LOCALES = ["en", "it", "nl", "de", "fr", "es", "pt", "pl", "sv"] as const;
|
|
|
|
export default async function CmsTranslationsPage() {
|
|
const messagesDir = path.join(process.cwd(), "messages");
|
|
|
|
const contents: Record<string, string> = {};
|
|
await Promise.all(
|
|
LOCALES.map(async (locale) => {
|
|
contents[locale] = await fs.readFile(path.join(messagesDir, `${locale}.json`), "utf-8");
|
|
}),
|
|
);
|
|
|
|
return <TranslationsClient localeContents={contents} />;
|
|
}
|