Show all available languages

Not just languages enabled in the browser. This makes the translations more discoverable.
This commit is contained in:
Philipp Oppermann
2020-11-11 10:28:36 +01:00
parent 307916d1fe
commit 668c903c02
3 changed files with 4 additions and 20 deletions

View File

@@ -1,6 +1,4 @@
window.onload = function() {
show_lang_selector();
var container = document.querySelector('#toc-aside');
if (container != null) {
@@ -63,17 +61,3 @@ function toc_scroll_position(container) {
current_toc_item.classList.add("active");
}
}
function show_lang_selector() {
var show_lang_selector = false;
for (language_selector of document.querySelectorAll('#language-selector li')) {
var lang = language_selector.getAttribute("data-lang-switch-to");
if (this.navigator.languages.includes(lang)) {
language_selector.classList.remove("hidden");
show_lang_selector = true
}
}
if (show_lang_selector) {
document.querySelector("#language-selector").classList.remove("hidden")
}
}