2019-08-24 04:43:12 +00:00
|
|
|
import { en } from './src/translations/en';
|
2019-08-26 21:42:53 +00:00
|
|
|
import { eo } from './src/translations/eo';
|
2019-08-24 04:43:12 +00:00
|
|
|
import { es } from './src/translations/es';
|
|
|
|
import { de } from './src/translations/de';
|
|
|
|
import { zh } from './src/translations/zh';
|
|
|
|
import { fr } from './src/translations/fr';
|
|
|
|
import { sv } from './src/translations/sv';
|
|
|
|
import { ru } from './src/translations/ru';
|
2019-08-29 18:20:21 +00:00
|
|
|
import { nl } from './src/translations/nl';
|
2019-10-21 07:02:20 +00:00
|
|
|
import { it } from './src/translations/it';
|
2019-08-24 04:43:12 +00:00
|
|
|
|
|
|
|
let files = [
|
2019-12-29 20:39:48 +00:00
|
|
|
{ t: de, n: 'de' },
|
|
|
|
{ t: eo, n: 'eo' },
|
|
|
|
{ t: es, n: 'es' },
|
|
|
|
{ t: fr, n: 'fr' },
|
|
|
|
{ t: it, n: 'it' },
|
|
|
|
{ t: nl, n: 'nl' },
|
|
|
|
{ t: ru, n: 'ru' },
|
|
|
|
{ t: sv, n: 'sv' },
|
|
|
|
{ t: zh, n: 'zh' },
|
2019-08-24 04:43:12 +00:00
|
|
|
];
|
|
|
|
let masterKeys = Object.keys(en.translation);
|
|
|
|
|
2019-08-25 00:58:55 +00:00
|
|
|
let report = 'lang | done | missing\n';
|
2019-08-24 04:43:12 +00:00
|
|
|
report += '--- | --- | ---\n';
|
|
|
|
|
|
|
|
for (let file of files) {
|
|
|
|
let keys = Object.keys(file.t.translation);
|
2019-12-29 20:39:48 +00:00
|
|
|
let pct: number = (keys.length / masterKeys.length) * 100;
|
2019-08-24 04:43:12 +00:00
|
|
|
let missing = difference(masterKeys, keys);
|
2019-08-25 00:58:55 +00:00
|
|
|
report += `${file.n} | ${pct.toFixed(0)}% | ${missing} \n`;
|
2019-08-24 04:43:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
console.log(report);
|
|
|
|
|
|
|
|
function difference(a: Array<string>, b: Array<string>): Array<string> {
|
|
|
|
return a.filter(x => !b.includes(x));
|
|
|
|
}
|