mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fix language dropdown
This commit is contained in:
parent
3c30ee6e81
commit
039dcc8f8c
24 changed files with 154 additions and 82 deletions
|
@ -29,10 +29,42 @@
|
|||
|
||||
}
|
||||
|
||||
function populateLanguages(select, languages) {
|
||||
|
||||
var html = "";
|
||||
|
||||
html += "<option value=''></option>";
|
||||
|
||||
for (var i = 0, length = languages.length; i < length; i++) {
|
||||
|
||||
var culture = languages[i];
|
||||
|
||||
html += "<option value='" + culture.TwoLetterISOLanguageName + "'>" + culture.DisplayName + "</option>";
|
||||
}
|
||||
|
||||
select.innerHTML = html;
|
||||
}
|
||||
|
||||
function populateCountries (select, allCountries) {
|
||||
|
||||
var html = "";
|
||||
|
||||
html += "<option value=''></option>";
|
||||
|
||||
for (var i = 0, length = allCountries.length; i < length; i++) {
|
||||
|
||||
var culture = allCountries[i];
|
||||
|
||||
html += "<option value='" + culture.TwoLetterISORegionName + "'>" + culture.DisplayName + "</option>";
|
||||
}
|
||||
|
||||
select.innerHTML = html;
|
||||
}
|
||||
|
||||
function reloadData(page, config, cultures, countries) {
|
||||
|
||||
Dashboard.populateLanguages($('#selectLanguage', page), cultures);
|
||||
Dashboard.populateCountries($('#selectCountry', page), countries);
|
||||
populateLanguages(page.querySelector('#selectLanguage'), cultures);
|
||||
populateCountries(page.querySelector('#selectCountry'), countries);
|
||||
|
||||
$('#selectLanguage', page).val(config.PreferredMetadataLanguage);
|
||||
$('#selectCountry', page).val(config.MetadataCountryCode);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue