Fix CMS translations path to src/messages.
Local Build and Deploy / deploy (push) Failing after 1m5s
Local Build and Deploy / deploy (push) Failing after 1m5s
Co-authored-by: Cursor <[email protected]>
This commit is contained in:
1 parent
d2c33145a2
commit
9b411e69b4
2 files changed
+10
-5
No files matched your search
@@ -46,6 +46,7 @@ export const saveTranslations = adminAction(
|
||||
async (ctx) => {
|
||||
const filePath = path.join(
|
||||
process.cwd(),
|
||||
"src",
|
||||
"messages",
|
||||
`${ctx.data.locale}.json`,
|
||||
);
|
||||
|
||||
@@ -28,15 +28,19 @@ const LOCALES = [
|
||||
] as const;
|
||||
|
||||
export default async function CmsTranslationsPage() {
|
||||
const messagesDir = path.join(process.cwd(), "messages");
|
||||
const messagesDir = path.join(process.cwd(), "src", "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",
|
||||
);
|
||||
try {
|
||||
contents[locale] = await fs.readFile(
|
||||
path.join(messagesDir, `${locale}.json`),
|
||||
"utf-8",
|
||||
);
|
||||
} catch {
|
||||
// Skip missing locale files instead of failing the whole page.
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
||||
|
||||
Reference in new issue
Block a user