mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 14:47:14 +01:00
Added script for checking language strings.
This commit is contained in:
parent
fd69f0df24
commit
b2a48b1c4c
2 changed files with 27 additions and 2 deletions
24
scripts/check-lang.js
Normal file
24
scripts/check-lang.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const chalk = require('chalk');
|
||||
const messages = require('../lang/en-US.json');
|
||||
|
||||
const dir = path.resolve(__dirname, '../lang');
|
||||
const files = fs.readdirSync(dir);
|
||||
const keys = Object.keys(messages).sort();
|
||||
|
||||
files.forEach(file => {
|
||||
if (file !== 'en-US.json') {
|
||||
const lang = require(`../lang/${file}`);
|
||||
|
||||
console.log(chalk.yellowBright(`\n## ${file}`));
|
||||
keys.forEach(key => {
|
||||
const orig = messages[key];
|
||||
const check = lang[key];
|
||||
|
||||
if (!check || check === orig) {
|
||||
console.log(chalk.redBright('*'), chalk.greenBright(`${key}:`), orig);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue