2020-10-01 04:30:39 +02:00
|
|
|
const fs = require('fs');
|
|
|
|
const path = require('path');
|
|
|
|
const chalk = require('chalk');
|
|
|
|
const messages = require('../lang/en-US.json');
|
2020-10-14 07:59:06 +02:00
|
|
|
const ignore = require('./lang-ignore.json');
|
2020-10-01 04:30:39 +02:00
|
|
|
|
|
|
|
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}`);
|
2020-10-14 07:59:06 +02:00
|
|
|
const id = file.replace('.json', '');
|
2020-10-01 04:30:39 +02:00
|
|
|
|
|
|
|
console.log(chalk.yellowBright(`\n## ${file}`));
|
|
|
|
keys.forEach(key => {
|
|
|
|
const orig = messages[key];
|
|
|
|
const check = lang[key];
|
2020-10-14 07:59:06 +02:00
|
|
|
const ignored = ignore[id]?.includes(key);
|
2020-10-01 04:30:39 +02:00
|
|
|
|
2020-10-14 07:59:06 +02:00
|
|
|
if (!ignored && (!check || check === orig)) {
|
2020-10-01 04:30:39 +02:00
|
|
|
console.log(chalk.redBright('*'), chalk.greenBright(`${key}:`), orig);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|