diff options
author | 0neGal <mail@0negal.com> | 2022-01-04 21:50:52 +0100 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2022-01-04 21:50:52 +0100 |
commit | 89d8d1986b62d5686160f28359383ccd0c67f77d (patch) | |
tree | fdd040950e1eda11bcc08a11170f28b1e6d11f7e /build/langs.js | |
parent | 8a2d5f76131a571aebe0b115c922c2380b8f9c97 (diff) | |
download | Viper-89d8d1986b62d5686160f28359383ccd0c67f77d.tar.gz Viper-89d8d1986b62d5686160f28359383ccd0c67f77d.zip |
added script to detect missing locales
"npm run langs" will give back info if a locale is missing localizations
from the English locale. Thereby showing what needs to be translated.
Diffstat (limited to 'build/langs.js')
-rw-r--r-- | build/langs.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/build/langs.js b/build/langs.js new file mode 100644 index 0000000..0e82022 --- /dev/null +++ b/build/langs.js @@ -0,0 +1,18 @@ +const fs = require("fs"); + +let lang = require("../src/lang/en.json"); + +langs = fs.readdirSync("src/lang") +langs.forEach((localefile) => { + let missing = []; + let locale = require("../src/lang/" + localefile) + for (let i in lang) { + if (! locale[i]) { + missing.push(i); + } + } + + if (missing.length > 0) { + console.error(`${localefile} is missing: ${missing}`) + } +}) |