From 89d8d1986b62d5686160f28359383ccd0c67f77d Mon Sep 17 00:00:00 2001 From: 0neGal Date: Tue, 4 Jan 2022 21:50:52 +0100 Subject: 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. --- build/langs.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 build/langs.js (limited to 'build') 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}`) + } +}) -- cgit v1.2.3