finish up translations and setup doc server stuff

This commit is contained in:
ngn
2025-01-10 00:16:06 +03:00
parent ac307de76c
commit 5fb3c03e40
30 changed files with 591 additions and 104 deletions

View File

@ -2,20 +2,30 @@
import { language, set_lang } from "$lib/util.js";
import languages from "$lib/lang.js";
let icon = "",
let icon = null,
indx = 0,
len = languages.length;
function next() {
if (indx >= languages.length) indx = 0;
function next_indx() {
if (indx + 1 >= len) return 0;
return indx + 1;
}
icon = languages[indx].icon;
set_lang(languages[indx++].code);
function next_lang(inc) {
let new_indx = next_indx();
if (inc) indx = new_indx;
return languages[new_indx];
}
function next() {
set_lang(next_lang(true).code);
icon = next_lang(false).icon;
}
for (indx = 0; indx < len; indx++) {
if (languages[indx].code == $language) {
icon = languages[indx++].icon;
set_lang(languages[indx].code);
icon = next_lang(false).icon;
break;
}
}