From a28e3812f95fd301201733bc2e7de24bb555ddb8 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Mon, 17 Jan 2022 14:47:03 +0100 Subject: documented: index.js, cli.js, lang.js app/lang.js --- src/app/lang.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/app') 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 %%%%, 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(""); } -- cgit v1.2.3