diff options
-rw-r--r-- | src/lang.js | 9 | ||||
-rw-r--r-- | src/lang/en.json (renamed from src/lang/en-US.json) | 0 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/lang.js b/src/lang.js index 4e4e481..266fb8b 100644 --- a/src/lang.js +++ b/src/lang.js @@ -1,10 +1,15 @@ const fs = require("fs"); -var lang = "en-US"; +var lang = "en"; if (fs.existsSync("viper.json")) { lang = JSON.parse(fs.readFileSync("viper.json", "utf8")).lang; + if (! lang) {lang = "en"} if (! fs.existsSync(__dirname + `/lang/${lang}.json`)) { - lang = "en-US"; + if (fs.existsSync(__dirname + `/lang/${lang.replace(/-.*$/, "")}.json`)) { + lang = lang.replace(/-.*$/, ""); + } else { + lang = "en"; + } } } diff --git a/src/lang/en-US.json b/src/lang/en.json index 2322369..2322369 100644 --- a/src/lang/en-US.json +++ b/src/lang/en.json |