From a91f0d2eac46510c109a4faebf520f68a3456aab Mon Sep 17 00:00:00 2001 From: 0neGal Date: Sat, 16 Sep 2023 01:28:38 +0200 Subject: lang files can now use objects! The `lang()` function doesn't change whatsoever, as the lang files are flattened and are therefore identical to the before this commit. I also cleaned up the files, and all the lang files should now all look far more similar in order. --- src/app/js/settings.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/app/js') diff --git a/src/app/js/settings.js b/src/app/js/settings.js index 682aa49..69ee7b8 100644 --- a/src/app/js/settings.js +++ b/src/app/js/settings.js @@ -67,9 +67,15 @@ var Settings = { div.innerHTML = ""; let langs = fs.readdirSync(__dirname + "/../lang"); for (let i in langs) { - title = JSON.parse(fs.readFileSync(__dirname + `/../lang/${langs[i]}`, "utf8"))["lang.title"]; + let lang_no_extension = langs[i].replace(/\..*$/, ""); + let title = lang("lang.title", lang_no_extension); + + if (title == "lang.title") { + continue; + } + if (title) { - div.innerHTML += `` + div.innerHTML += `` } } -- cgit v1.2.3