Updated lang files.

This commit is contained in:
Mike Cao 2023-04-22 00:55:55 -07:00
parent 6cb2429ee1
commit 8666965930
3 changed files with 12 additions and 3 deletions

View file

@ -4,11 +4,15 @@ const del = require('del');
const prettier = require('prettier');
const src = path.resolve(__dirname, '../lang');
const dest = path.resolve(__dirname, '../build');
const dest = path.resolve(__dirname, '../build/messages');
const files = fs.readdirSync(src);
del.sync([path.join(dest, '*.json')]);
del.sync([path.join(dest)]);
/*
This script takes the files from the `lang` folder and formats them into
the format that format-js expects.
*/
async function run() {
await fs.ensureDir(dest);

View file

@ -8,6 +8,11 @@ const dest = path.resolve(__dirname, '../lang');
const files = fs.readdirSync(dest);
const keys = Object.keys(messages).sort();
/*
This script takes extracted messages and merges them
with the existing files under `lang`. Any newly added
keys will be printed to the console.
*/
files.forEach(file => {
const lang = require(`../lang/${file}`);