diff options
Diffstat (limited to 'static/js/tl.js')
| -rw-r--r-- | static/js/tl.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/static/js/tl.js b/static/js/tl.js index dd6a34b8..9fa8808f 100644 --- a/static/js/tl.js +++ b/static/js/tl.js @@ -14,8 +14,6 @@ var currentLang = document.cookie.replace( "$1" ); -console.log("currentLang: " + currentLang); - if (currentLang == "ja") { triggerTranslation("ja"); } else { @@ -27,14 +25,17 @@ function triggerTranslation(language) { if (!selectEl) { setTimeout(function () { triggerTranslation(language); - }, 100); + }, 10); } else if (!selectEl.options || selectEl.options.length === 0) { setTimeout(function () { triggerTranslation(language); - }, 100); + }, 10); } else { - // Continue with the logic for handling the available options - selectEl.value = language; // Change the value of the select element - selectEl.dispatchEvent(new Event("change")); // Trigger change event + selectEl.value = language; + selectEl.dispatchEvent(new Event("change")); + // visiblity of #main-section is hidden until translation is done, show it after translation is done + setTimeout(function () { + document.getElementById("main-section").style.visibility = "visible"; + }, 200); } } |
