Fix locale dropdown defaulting to blank on some locales (for real hopefully this time)

Co-Authored-By: mrjvs <mistrjvs@gmail.com>
This commit is contained in:
montylion
2021-08-27 00:03:21 +02:00
parent 738a59fafd
commit 10513bad80

View File

@@ -1,6 +1,11 @@
function setDefaultDropdownLocale(localeString) {
const selected = document.querySelector(".selected-locale");
selected.innerHTML = document.querySelector(`label[for=${localeString}`).innerHTML
let item = document.querySelector(`label[for=${localeString}`);
if (!item) { // if locale cant be find, default to en-US
localeString = "en-US";
item = document.querySelector(`label[for=${localeString}`);
}
selected.innerHTML = item.innerHTML
}
function localeDropdownHandler(selectedLocale) {