mirror of
https://github.com/kremalicious/umami.git
synced 2025-01-11 21:45:53 +01:00
Updated lang files.
This commit is contained in:
parent
6cb2429ee1
commit
8666965930
@ -32,7 +32,7 @@
|
|||||||
"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",
|
||||||
"compile-lang": "formatjs compile-folder --ast build public/intl/messages",
|
"compile-lang": "formatjs compile-folder --ast build/messages public/intl/messages",
|
||||||
"check-lang": "node scripts/check-lang.js",
|
"check-lang": "node scripts/check-lang.js",
|
||||||
"download-country-names": "node scripts/download-country-names.js",
|
"download-country-names": "node scripts/download-country-names.js",
|
||||||
"download-language-names": "node scripts/download-language-names.js",
|
"download-language-names": "node scripts/download-language-names.js",
|
||||||
|
@ -4,11 +4,15 @@ const del = require('del');
|
|||||||
const prettier = require('prettier');
|
const prettier = require('prettier');
|
||||||
|
|
||||||
const src = path.resolve(__dirname, '../lang');
|
const src = path.resolve(__dirname, '../lang');
|
||||||
const dest = path.resolve(__dirname, '../build');
|
const dest = path.resolve(__dirname, '../build/messages');
|
||||||
const files = fs.readdirSync(src);
|
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() {
|
async function run() {
|
||||||
await fs.ensureDir(dest);
|
await fs.ensureDir(dest);
|
||||||
|
|
||||||
|
@ -8,6 +8,11 @@ const dest = path.resolve(__dirname, '../lang');
|
|||||||
const files = fs.readdirSync(dest);
|
const files = fs.readdirSync(dest);
|
||||||
const keys = Object.keys(messages).sort();
|
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 => {
|
files.forEach(file => {
|
||||||
const lang = require(`../lang/${file}`);
|
const lang = require(`../lang/${file}`);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user