Nicening translation report.

This commit is contained in:
Dessalines 2019-08-24 17:58:55 -07:00
parent e4ee79fab2
commit ccb58f6ff2
2 changed files with 13 additions and 12 deletions

15
README.md vendored
View file

@ -167,14 +167,15 @@ If you'd like to add translations, take a look a look at the [english translatio
### Report ### Report
lang | missing | percent lang | done | missing
--- | --- | --- --- | --- | ---
es | cross_posts,cross_post,by,to,transfer_community,transfer_site | 96% de | 91% | cross_posts,cross_post,users,settings,subscribed,expires,nsfw,show_nsfw,crypto,monero,joined,by,to,transfer_community,transfer_site
de | cross_posts,cross_post,users,settings,subscribed,expires,nsfw,show_nsfw,crypto,monero,joined,by,to,transfer_community,transfer_site | 91% es | 96% | cross_posts,cross_post,by,to,transfer_community,transfer_site
zh | cross_posts,cross_post,users,settings,nsfw,show_nsfw,monero,by,to,transfer_community,transfer_site | 93% fr | 93% | cross_posts,cross_post,users,settings,nsfw,show_nsfw,monero,by,to,transfer_community,transfer_site
fr | cross_posts,cross_post,users,settings,nsfw,show_nsfw,monero,by,to,transfer_community,transfer_site | 93% ru | 96% | cross_posts,cross_post,monero,by,to,transfer_community,transfer_site
sv | cross_posts,cross_post,settings,nsfw,show_nsfw,monero,by,to,transfer_community,transfer_site | 94% sv | 94% | cross_posts,cross_post,settings,nsfw,show_nsfw,monero,by,to,transfer_community,transfer_site
ru | cross_posts,cross_post,monero,by,to,transfer_community,transfer_site | 96% zh | 93% | cross_posts,cross_post,users,settings,nsfw,show_nsfw,monero,by,to,transfer_community,transfer_site
## Credits ## Credits

View file

@ -7,23 +7,23 @@ import { sv } from './src/translations/sv';
import { ru } from './src/translations/ru'; import { ru } from './src/translations/ru';
let files = [ let files = [
{t: es, n: 'es'},
{t: de, n: 'de'}, {t: de, n: 'de'},
{t: zh, n: 'zh'}, {t: es, n: 'es'},
{t: fr, n: 'fr'}, {t: fr, n: 'fr'},
{t: sv, n: 'sv'},
{t: ru, n: 'ru'}, {t: ru, n: 'ru'},
{t: sv, n: 'sv'},
{t: zh, n: 'zh'},
]; ];
let masterKeys = Object.keys(en.translation); let masterKeys = Object.keys(en.translation);
let report = 'lang | missing | percent\n'; let report = 'lang | done | missing\n';
report += '--- | --- | ---\n'; report += '--- | --- | ---\n';
for (let file of files) { for (let file of files) {
let keys = Object.keys(file.t.translation); let keys = Object.keys(file.t.translation);
let pct: number = (keys.length / masterKeys.length * 100); let pct: number = (keys.length / masterKeys.length * 100);
let missing = difference(masterKeys, keys); let missing = difference(masterKeys, keys);
report += `${file.n} | ${missing} | ${pct.toFixed(0)}%\n`; report += `${file.n} | ${pct.toFixed(0)}% | ${missing} \n`;
} }
console.log(report); console.log(report);