mirror of
https://github.com/Radiquum/radiquum.github.io.git
synced 2025-04-27 08:29:35 +05:00
feat: finished of Kentai Radiquum Character Page
This commit is contained in:
parent
da0666897a
commit
61a678df10
4 changed files with 323 additions and 11 deletions
|
@ -26,12 +26,15 @@ function parseLink(string) {
|
|||
|
||||
const i18nTags = document.querySelectorAll("[data-i18n]");
|
||||
const i18nStyles = document.querySelectorAll("[data-i18n-style]");
|
||||
const i18nHrefs = document.querySelectorAll("[data-i18n-href]");
|
||||
function changeLanguage(lang) {
|
||||
let strings = {};
|
||||
let styles = {};
|
||||
let hrefs = {};
|
||||
if (lang == "ru") {
|
||||
strings = i18n_ru;
|
||||
styles = i18n_ru_style;
|
||||
hrefs = i18n_ru_href;
|
||||
}
|
||||
|
||||
for (let i = 0; i < i18nTags.length; i++) {
|
||||
|
@ -56,6 +59,15 @@ function changeLanguage(lang) {
|
|||
|
||||
element.style.cssText = styles[id];
|
||||
}
|
||||
for (let i = 0; i < i18nHrefs.length; i++) {
|
||||
const element = i18nHrefs[i];
|
||||
const id = element.getAttribute("data-i18n-href");
|
||||
if (!hrefs[id]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
element.href = hrefs[id];
|
||||
}
|
||||
}
|
||||
|
||||
function detectAndChangeLanguage() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue