You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.1 KiB

  1. import { en } from './src/translations/en';
  2. import { eo } from './src/translations/eo';
  3. import { es } from './src/translations/es';
  4. import { de } from './src/translations/de';
  5. import { zh } from './src/translations/zh';
  6. import { fr } from './src/translations/fr';
  7. import { sv } from './src/translations/sv';
  8. import { ru } from './src/translations/ru';
  9. import { nl } from './src/translations/nl';
  10. let files = [
  11. {t: de, n: 'de'},
  12. {t: eo, n: 'eo'},
  13. {t: es, n: 'es'},
  14. {t: fr, n: 'fr'},
  15. {t: nl, n: 'nl'},
  16. {t: ru, n: 'ru'},
  17. {t: sv, n: 'sv'},
  18. {t: zh, n: 'zh'},
  19. ];
  20. let masterKeys = Object.keys(en.translation);
  21. let report = 'lang | done | missing\n';
  22. report += '--- | --- | ---\n';
  23. for (let file of files) {
  24. let keys = Object.keys(file.t.translation);
  25. let pct: number = (keys.length / masterKeys.length * 100);
  26. let missing = difference(masterKeys, keys);
  27. report += `${file.n} | ${pct.toFixed(0)}% | ${missing} \n`;
  28. }
  29. console.log(report);
  30. function difference(a: Array<string>, b: Array<string>): Array<string> {
  31. return a.filter(x => !b.includes(x));
  32. }