aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/app/main.js3
-rw-r--r--src/index.js1
-rw-r--r--src/utils.js6
3 files changed, 9 insertions, 1 deletions
diff --git a/src/app/main.js b/src/app/main.js
index a3a5676..579f785 100644
--- a/src/app/main.js
+++ b/src/app/main.js
@@ -7,12 +7,15 @@ const lang = require("../lang");
var settings = {
gamepath: "",
zip: "/northstar.zip",
+ lang: navigator.language,
excludes: [
"ns_startup_args.txt",
"ns_startup_args_dedi.txt"
]
}
+ipcRenderer.send("setlang", settings.lang);
+
if (fs.existsSync("viper.json")) {
settings = {...settings, ...JSON.parse(fs.readFileSync("viper.json", "utf8"))};
settings.zip = path.join(settings.gamepath + "/northstar.zip");
diff --git a/src/index.js b/src/index.js
index 4e64414..fead15b 100644
--- a/src/index.js
+++ b/src/index.js
@@ -33,6 +33,7 @@ function start() {
}
ipcMain.on("launch", (event) => {utils.launch()})
+ipcMain.on("setlang", (event, lang) => {utils.setlang(lang)})
ipcMain.on("launchVanilla", (event) => {utils.launch("vanilla")})
ipcMain.on("update", (event) => {utils.update()})
diff --git a/src/utils.js b/src/utils.js
index 85ce5ce..ec15554 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -16,6 +16,7 @@ process.chdir(app.getPath("appData"));
var settings = {
gamepath: "",
+ lang: "en-US",
zip: "/northstar.zip",
excludes: [
"ns_startup_args.txt",
@@ -30,7 +31,6 @@ if (fs.existsSync("viper.json")) {
console.log("Game path is not set! Please select the path.");
}
-
function setpath(win) {
if (! win) {
settings.gamepath = cli.param("setpath");
@@ -110,4 +110,8 @@ module.exports = {
update,
setpath,
settings,
+ setlang: (lang) => {
+ settings.lang = lang;
+ saveSettings();
+ },
}