aboutsummaryrefslogtreecommitdiff
path: root/src/app/lang.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2022-01-19 23:51:26 +0100
committerGitHub <noreply@github.com>2022-01-19 23:51:26 +0100
commit057b60f4843798441ad441370381b87299d5ad7f (patch)
treeef0ac85051f0abb8b0febfc507ad5c71a5e7e3e8 /src/app/lang.js
parent962265ffbe3aa0a9c2084d370c914c0265ee6bd9 (diff)
parentae7de46f4748c800097f0f3c700e6525d7d7cc4f (diff)
downloadViper-057b60f4843798441ad441370381b87299d5ad7f.tar.gz
Viper-057b60f4843798441ad441370381b87299d5ad7f.zip
Merge branch 'main' into enabledmods
Diffstat (limited to 'src/app/lang.js')
-rw-r--r--src/app/lang.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/app/lang.js b/src/app/lang.js
index 5cc9708..6fdcd8d 100644
--- a/src/app/lang.js
+++ b/src/app/lang.js
@@ -1,12 +1,19 @@
+// Replaces strings in the HTML will language strings properly. This
+// searches for %%<string>%%, aka, %%gui.exit%% will be replaced with
+// "Exit", this works without issues.
function setlang() {
+ // Finds %%%% strings
html = document.body.innerHTML.split("%%");
for (let i = 0; i < html.length; i++) {
+ // Simply checks to make sure it is actually a lang string.
if (html[i][0] != " " &&
html[i][html[i].length - 1] != " ") {
+ // Replaces it with it's string
html[i] = lang(html[i])
}
}
-
+
+ // Replaces the original HTML with the translated/replaced HTML
document.body.innerHTML = html.join("");
}