42 lines
723 B
TypeScript
42 lines
723 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",
|
|
"tr",
|
|
"ro",
|
|
"hu",
|
|
"cs",
|
|
"sk",
|
|
"da",
|
|
"no",
|
|
"el",
|
|
"bg",
|
|
"hr",
|
|
"sr",
|
|
"uk",
|
|
"ru",
|
|
] 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} />;
|
|
}
|