From b713ee0ec5292e150b60646795bee87c6b041256 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Sat, 29 Feb 2020 20:35:25 +0100 Subject: remove translation report from readme --- ui/package.json | 2 +- ui/translation_report.ts | 62 ------------------------------------------------ 2 files changed, 1 insertion(+), 63 deletions(-) delete mode 100644 ui/translation_report.ts (limited to 'ui') diff --git a/ui/package.json b/ui/package.json index d24bc265..6cb2092c 100644 --- a/ui/package.json +++ b/ui/package.json @@ -63,7 +63,7 @@ "engineStrict": true, "husky": { "hooks": { - "pre-commit": "yarn run ts-node translation_report.ts && git add ../README.md && cargo clippy --manifest-path ../server/Cargo.toml --all-targets --all-features -- -D warnings && lint-staged" + "pre-commit": "git add ../README.md && cargo clippy --manifest-path ../server/Cargo.toml --all-targets --all-features -- -D warnings && lint-staged" } }, "lint-staged": { diff --git a/ui/translation_report.ts b/ui/translation_report.ts deleted file mode 100644 index d68cb5e8..00000000 --- a/ui/translation_report.ts +++ /dev/null @@ -1,62 +0,0 @@ -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 { fa } from './src/translations/fa'; -import { zh } from './src/translations/zh'; -import { fr } from './src/translations/fr'; -import { sv } from './src/translations/sv'; -import { ru } from './src/translations/ru'; -import { nl } from './src/translations/nl'; -import { it } from './src/translations/it'; -import { fi } from './src/translations/fi'; -import { ca } from './src/translations/ca'; -import { pt_br } from './src/translations/pt_br'; -import fs from 'fs'; - -const files = [ - { t: ca, n: 'ca' }, - { t: de, n: 'de' }, - { t: fa, n: 'fa' }, - { t: eo, n: 'eo' }, - { t: es, n: 'es' }, - { t: fi, n: 'fi' }, - { t: fr, n: 'fr' }, - { t: it, n: 'it' }, - { t: nl, n: 'nl' }, - { t: pt_br, n: 'pt-br' }, - { t: ru, n: 'ru' }, - { t: sv, n: 'sv' }, - { t: zh, n: 'zh' }, -]; -const masterKeys = Object.keys(en.translation); - -const readmePath = '../README.md'; - -const open = ''; -const close = ''; - -const readmeTxt = fs.readFileSync(readmePath, { encoding: 'utf8' }); - -const before = readmeTxt.split(open)[0]; -const after = readmeTxt.split(close)[1]; - -function difference(a: Array, b: Array): Array { - return a.filter(x => !b.includes(x)); -} - -const report = - 'lang | done | missing\n' + - '---- | ---- | -------\n' + - files - .map(file => { - const keys = Object.keys(file.t.translation); - const pct: number = (keys.length / masterKeys.length) * 100; - const missing = difference(masterKeys, keys); - return `${file.n} | ${pct.toFixed(0)}% | ${missing}`; - }) - .join('\n'); - -const alteredReadmeTxt = `${before}${open}\n\n${report}\n${close}${after}`; - -fs.writeFileSync(readmePath, alteredReadmeTxt); -- cgit v1.2.3