aboutsummaryrefslogtreecommitdiff
path: root/build/langs.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2022-05-02 21:49:20 +0200
committerGitHub <noreply@github.com>2022-05-02 21:49:20 +0200
commitc40e331bdc4b2375d3802a515c9b7a032118dea7 (patch)
tree77c8d84c0fc9d0fbb742cfeeb80efa4762784a9d /build/langs.js
parent9f2f77558238c28ceb8ff4fca2096602671779e5 (diff)
parent847a2178e7823749e3096daf24dfcd3df8b236cb (diff)
downloadViper-c40e331bdc4b2375d3802a515c9b7a032118dea7.tar.gz
Viper-c40e331bdc4b2375d3802a515c9b7a032118dea7.zip
Merge branch 'main' into enabledmods
Diffstat (limited to 'build/langs.js')
-rw-r--r--build/langs.js24
1 files changed, 21 insertions, 3 deletions
diff --git a/build/langs.js b/build/langs.js
index 9e21dff..e870a3c 100644
--- a/build/langs.js
+++ b/build/langs.js
@@ -1,5 +1,6 @@
const fs = require("fs");
+let problems = false;
let lang = require("../src/lang/en.json");
let maintainers = require("../src/lang/maintainers.json");
@@ -9,7 +10,14 @@ langs.forEach((localefile) => {
let missing = [];
let langmaintainers = maintainers.list[localefile.replace(/\..*$/, "")];
- let locale = require("../src/lang/" + localefile)
+ let locale = false;
+ try {
+ locale = require("../src/lang/" + localefile)
+ }catch(err) {
+ console.log(`\x1b[101m!! ${localefile} is not formatted right !!\x1b[0m`);
+ return
+ }
+
for (let i in lang) {
if (! locale[i]) {
missing.push(i);
@@ -17,16 +25,26 @@ langs.forEach((localefile) => {
}
if (missing.length > 0) {
+ problems = true;
+
console.error(`${localefile} is missing:`)
for (let i in missing) {
- console.log(` ${missing[i]}`)
+ console.log(`\x1b[31m ${missing[i]}\x1b[0m`)
}
console.log()
- console.log("Maintainers of language: ")
+ console.log("Maintainers: ")
for (let i in langmaintainers) {
console.log(` ${langmaintainers[i]}`)
}
+
+ console.log("\n")
}
})
+
+if (! problems) {
+ console.log("\x1b[32mAll localizations are complete and formatted properly.\x1b[0m");
+} else {
+ process.exit(1);
+}