aboutsummaryrefslogtreecommitdiff
path: root/src/lang.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lang.js')
-rw-r--r--src/lang.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lang.js b/src/lang.js
index 3e0ca42..8174174 100644
--- a/src/lang.js
+++ b/src/lang.js
@@ -1,7 +1,7 @@
const fs = require("fs");
const enLang = JSON.parse(fs.readFileSync(__dirname + `/lang/en.json`, "utf8"));
-let lang = "en";
+let lang = "";
var langObj = {};
@@ -16,13 +16,16 @@ function _loadTranslation() {
lang = "en";
}
}
+ } else {
+ lang = "en";
}
langObj = JSON.parse(fs.readFileSync(__dirname + `/lang/${lang}.json`, "utf8"));
}
module.exports = (string) => {
- _loadTranslation();
+ if (lang === "")
+ _loadTranslation();
if (langObj[string]) {
return langObj[string];