Add admin import overview page and extend CMS translations to all 6 locales
Local Build and Deploy / deploy (push) Successful in 51s
Local Build and Deploy / deploy (push) Successful in 51s
This commit is contained in:
1 parent
2e4ed76121
commit
6933fb77d5
4 files changed
+100
-29
No files matched your search
@@ -2,10 +2,17 @@ import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { TranslationsClient } from "../translations-client";
|
||||
|
||||
const LOCALES = ["en", "it", "nl", "de", "fr", "es"] as const;
|
||||
|
||||
export default async function CmsTranslationsPage() {
|
||||
const messagesDir = path.join(process.cwd(), "messages");
|
||||
const enContent = await fs.readFile(path.join(messagesDir, "en.json"), "utf-8");
|
||||
const itContent = await fs.readFile(path.join(messagesDir, "it.json"), "utf-8");
|
||||
|
||||
return <TranslationsClient enJson={enContent} itJson={itContent} />;
|
||||
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} />;
|
||||
}
|
||||
Reference in new issue
Block a user