aboutsummaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2023-09-16 02:17:46 +0200
committer0neGal <mail@0negal.com>2023-09-16 02:20:05 +0200
commitb125018808b43fac9f5c81d7e7b07ec92eef30fc (patch)
tree1356b2236b3f26525d1fc13f10b684ac0baebb30 /src/app
parenta91f0d2eac46510c109a4faebf520f68a3456aab (diff)
downloadViper-b125018808b43fac9f5c81d7e7b07ec92eef30fc.tar.gz
Viper-b125018808b43fac9f5c81d7e7b07ec92eef30fc.zip
made some lang keys far more logical
Most of these are from back when Viper was originally started, I also removed a few keys as they were no longer in use, but were forgotten about, most of these are from pre-v1.0.0 aka, the old smaller UI
Diffstat (limited to 'src/app')
-rw-r--r--src/app/index.html6
-rw-r--r--src/app/js/browser.js8
-rw-r--r--src/app/js/mods.js10
-rw-r--r--src/app/js/settings.js9
-rw-r--r--src/app/main.js6
5 files changed, 21 insertions, 18 deletions
diff --git a/src/app/index.html b/src/app/index.html
index c61960f..4a8dca9 100644
--- a/src/app/index.html
+++ b/src/app/index.html
@@ -26,7 +26,7 @@
<div id="dragUI">
<div id="dragitems">
<div id="icon"></div>
- <div id="text">%%gui.mods.dragdrop%%</div>
+ <div id="text">%%gui.mods.drag_n_drop%%</div>
</div>
</div>
@@ -238,8 +238,8 @@
<div class="line">
<div class="text" id="modcount">%%gui.mods.title%%</div>
<div class="buttons modbtns">
- <button id="removeall" class="bg-red2" onclick="mods.remove('allmods')">%%gui.mods.removeall%%</button>
- <button id="toggleall" class="bg-orange2" onclick="mods.toggle('allmods')">%%gui.mods.toggleall%%</button>
+ <button id="removeall" class="bg-red2" onclick="mods.remove('allmods')">%%gui.mods.remove_all%%</button>
+ <button id="toggleall" class="bg-orange2" onclick="mods.toggle('allmods')">%%gui.mods.toggle_all%%</button>
<button id="installmod" class="bg-blue" onclick="installmod()">%%gui.mods.install%%</button>
<button id="findmod" class="bg-blue2" onclick="Browser.toggle(true)">%%gui.mods.find%%</button>
</div>
diff --git a/src/app/js/browser.js b/src/app/js/browser.js
index f3b11c9..8283e9b 100644
--- a/src/app/js/browser.js
+++ b/src/app/js/browser.js
@@ -231,7 +231,7 @@ var Browser = {
return
}
- Browser.msg(`<button id="loadmore">${lang("gui.browser.loadmore")}</button>`);
+ Browser.msg(`<button id="loadmore">${lang("gui.browser.load_more")}</button>`);
loadmore.addEventListener("click", () => {
Browser.loadpkgs(pkgs);
Browser.endoflist(! pkgs.length);
@@ -427,7 +427,7 @@ function BrowserEl(properties) {
<button class="visual">${properties.version}</button>
<button class="visual">
- ${lang("gui.browser.madeby")}
+ ${lang("gui.browser.made_by")}
${properties.author}
</button>
</div>
@@ -490,8 +490,8 @@ ipcRenderer.on("no-internet", (event, modname) => {
new Toast({
timeout: 10000,
scheme: "error",
- title: lang("gui.toast.noInternet.title"),
- description: lang("gui.toast.noInternet.desc")
+ title: lang("gui.toast.title.no_internet"),
+ description: lang("gui.toast.desc.no_internet")
})
})
diff --git a/src/app/js/mods.js b/src/app/js/mods.js
index 696f01a..b17cadd 100644
--- a/src/app/js/mods.js
+++ b/src/app/js/mods.js
@@ -63,7 +63,7 @@ mods.load = (mods_obj) => {
<button class="visual">${version.format(mod_details.version)}</button>
<button class="visual">
- ${lang("gui.browser.madeby")}
+ ${lang("gui.browser.made_by")}
${mod.author || lang("gui.mods.unknown_author")}
</button>
</div>
@@ -183,11 +183,11 @@ mods.load = (mods_obj) => {
mods.remove = (mod) => {
if (mod.toLowerCase().match(/^northstar\./)) {
- if (! confirm(lang("gui.mods.required.confirm"))) {
+ if (! confirm(lang("gui.mods.required_confirm"))) {
return;
}
} else if (mod == "allmods") {
- if (! confirm(lang("gui.mods.removeall.confirm"))) {
+ if (! confirm(lang("gui.mods.remove_all.confirm"))) {
return;
}
}
@@ -197,11 +197,11 @@ mods.remove = (mod) => {
mods.toggle = (mod) => {
if (mod.toLowerCase().match(/^northstar\./)) {
- if (! confirm(lang("gui.mods.required.confirm"))) {
+ if (! confirm(lang("gui.mods.required_confirm"))) {
return;
}
} else if (mod == "allmods") {
- if (! confirm(lang("gui.mods.toggleall.confirm"))) {
+ if (! confirm(lang("gui.mods.toggle_all_confirm"))) {
return;
}
}
diff --git a/src/app/js/settings.js b/src/app/js/settings.js
index 69ee7b8..db29300 100644
--- a/src/app/js/settings.js
+++ b/src/app/js/settings.js
@@ -65,15 +65,18 @@ var Settings = {
let div = options[i].querySelector("select");
div.innerHTML = "";
- let langs = fs.readdirSync(__dirname + "/../lang");
+ let lang_dir = __dirname + "/../lang";
+ let langs = fs.readdirSync(lang_dir);
for (let i in langs) {
+ let lang_file = require(lang_dir + "/" + langs[i]);
let lang_no_extension = langs[i].replace(/\..*$/, "");
- let title = lang("lang.title", lang_no_extension);
- if (title == "lang.title") {
+ if (! lang_file.lang || ! lang_file.lang.title) {
continue;
}
+ let title = lang_file.lang.title;
+
if (title) {
div.innerHTML += `<option value="${lang_no_extension}">${title}</option>`
}
diff --git a/src/app/main.js b/src/app/main.js
index b7058ce..f7deb41 100644
--- a/src/app/main.js
+++ b/src/app/main.js
@@ -177,7 +177,7 @@ ipcRenderer.on("ns-update-event", (event, key) => {
console.log(lang(key));
switch(key) {
case "cli.update.uptodate.short":
- case "cli.update.noInternet":
+ case "cli.update.no_internet":
setButtons(true);
playNsBtn.innerText = lang("gui.launch");
break;
@@ -241,7 +241,7 @@ function installFromURL(url, dependencies, clearqueue, author, package_name, ver
package_name: pkg[1]
});
- prettydepends.push(`${pkg[1]} v${pkg[2]} - ${lang("gui.browser.madeby")} ${pkg[0]}`);
+ prettydepends.push(`${pkg[1]} v${pkg[2]} - ${lang("gui.browser.made_by")} ${pkg[0]}`);
}
}
}
@@ -356,7 +356,7 @@ ipcRenderer.on("version", (event, versions) => {
// Since Northstar is not installed, we cannot launch it
shouldInstallNorthstar = true;
- playNsBtn.innerText = lang("gui.installnorthstar");
+ playNsBtn.innerText = lang("gui.install");
}
}); ipcRenderer.send("get-version");