diff options
author | 0neGal <mail@0negal.com> | 2023-01-29 22:22:22 +0100 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2023-01-29 22:22:22 +0100 |
commit | 052d121b06021729274ee7ac68b3d306c968687d (patch) | |
tree | 352b491b746555171a8bb7ce5e880b2d39c38b15 /src/lang.js | |
parent | 64aad4e22abd95b67ee657723e31257419bed662 (diff) | |
parent | 4b94ba7ae03317e1dee75d637f7355f49c1f2086 (diff) | |
download | Viper-052d121b06021729274ee7ac68b3d306c968687d.tar.gz Viper-052d121b06021729274ee7ac68b3d306c968687d.zip |
Merge branch 'main' into linux-launch
Diffstat (limited to 'src/lang.js')
-rw-r--r-- | src/lang.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lang.js b/src/lang.js index f2fab3a..85488d8 100644 --- a/src/lang.js +++ b/src/lang.js @@ -1,6 +1,8 @@ const fs = require("fs"); -const enLang = JSON.parse(fs.readFileSync(__dirname + `/lang/en.json`, "utf8")); +const json = require("./modules/json"); + +const enLang = json(__dirname + "/lang/en.json"); let lang = ""; var langObj = {}; @@ -14,7 +16,7 @@ function _loadTranslation(forcedlang) { } try { - opts = JSON.parse(fs.readFileSync("viper.json", "utf8")); + opts = json("viper.json"); }catch (e) {} lang = opts.lang; @@ -39,7 +41,7 @@ function _loadTranslation(forcedlang) { lang = "en"; } - langObj = JSON.parse(fs.readFileSync(__dirname + `/lang/${lang}.json`, "utf8")); + langObj = json(__dirname + `/lang/${lang}.json`); } |