mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-23 12:51:18 +00:00
35 lines
1,017 B
TypeScript
Vendored
35 lines
1,017 B
TypeScript
Vendored
import { en } from './src/translations/en';
|
|
import { eo } from './src/translations/eo';
|
|
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';
|
|
|
|
let files = [
|
|
{t: de, n: 'de'},
|
|
{t: es, n: 'es'},
|
|
{t: eo, n: 'eo'},
|
|
{t: fr, n: 'fr'},
|
|
{t: ru, n: 'ru'},
|
|
{t: sv, n: 'sv'},
|
|
{t: zh, n: 'zh'},
|
|
];
|
|
let masterKeys = Object.keys(en.translation);
|
|
|
|
let report = 'lang | done | missing\n';
|
|
report += '--- | --- | ---\n';
|
|
|
|
for (let file of files) {
|
|
let keys = Object.keys(file.t.translation);
|
|
let pct: number = (keys.length / masterKeys.length * 100);
|
|
let missing = difference(masterKeys, keys);
|
|
report += `${file.n} | ${pct.toFixed(0)}% | ${missing} \n`;
|
|
}
|
|
|
|
console.log(report);
|
|
|
|
function difference(a: Array<string>, b: Array<string>): Array<string> {
|
|
return a.filter(x => !b.includes(x));
|
|
}
|