update lang scripts

This commit is contained in:
Maxime-J 2023-08-31 16:32:17 +00:00
parent c7275ef85b
commit be886db0f2
2 changed files with 3 additions and 3 deletions

View File

@ -30,7 +30,7 @@
"check-db": "node scripts/check-db.js", "check-db": "node scripts/check-db.js",
"check-env": "node scripts/check-env.js", "check-env": "node scripts/check-env.js",
"copy-db-files": "node scripts/copy-db-files.js", "copy-db-files": "node scripts/copy-db-files.js",
"extract-messages": "formatjs extract \"{pages,components}/**/*.js\" --out-file build/messages.json", "extract-messages": "formatjs extract \"src/{pages,components}/**/*.js\" --out-file build/messages.json",
"merge-messages": "node scripts/merge-messages.js", "merge-messages": "node scripts/merge-messages.js",
"generate-lang": "npm-run-all extract-messages merge-messages", "generate-lang": "npm-run-all extract-messages merge-messages",
"format-lang": "node scripts/format-lang.js", "format-lang": "node scripts/format-lang.js",

View File

@ -4,7 +4,7 @@ const path = require('path');
const prettier = require('prettier'); const prettier = require('prettier');
const messages = require('../build/messages.json'); const messages = require('../build/messages.json');
const dest = path.resolve(__dirname, '../lang'); const dest = path.resolve(__dirname, '../src/lang');
const files = fs.readdirSync(dest); const files = fs.readdirSync(dest);
const keys = Object.keys(messages).sort(); const keys = Object.keys(messages).sort();
@ -14,7 +14,7 @@ with the existing files under `lang`. Any newly added
keys will be printed to the console. keys will be printed to the console.
*/ */
files.forEach(file => { files.forEach(file => {
const lang = require(`../lang/${file}`); const lang = require(`../src/lang/${file}`);
console.log(`Merging ${file}`); console.log(`Merging ${file}`);