mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
globalization fix
This commit is contained in:
parent
64354206a0
commit
ac5697b240
8 changed files with 47 additions and 35 deletions
|
@ -44,8 +44,7 @@
|
|||
CameraUploadPath: $('#txtUploadPath', page).val()
|
||||
|
||||
}),
|
||||
contentType: "application/json",
|
||||
dataType: 'json'
|
||||
contentType: "application/json"
|
||||
|
||||
}).then(Dashboard.processServerConfigurationUpdateResult);
|
||||
}
|
||||
|
|
|
@ -35,6 +35,22 @@
|
|||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', requestUrl, true);
|
||||
|
||||
var onError = function () {
|
||||
|
||||
Logger.log('Dictionary not found. Reverting to english');
|
||||
|
||||
// Grab the english version
|
||||
var xhr2 = new XMLHttpRequest();
|
||||
xhr2.open('GET', getUrl(name, 'en-US'), true);
|
||||
|
||||
xhr2.onload = function (e) {
|
||||
dictionaries[url] = JSON.parse(this.response);
|
||||
resolve();
|
||||
};
|
||||
|
||||
xhr2.send();
|
||||
};
|
||||
|
||||
xhr.onload = function (e) {
|
||||
|
||||
Logger.log('Globalize response status: ' + this.status);
|
||||
|
@ -45,20 +61,12 @@
|
|||
resolve();
|
||||
|
||||
} else {
|
||||
|
||||
// Grab the english version
|
||||
var xhr2 = new XMLHttpRequest();
|
||||
xhr2.open('GET', getUrl(name, 'en-US'), true);
|
||||
|
||||
xhr2.onload = function (e) {
|
||||
dictionaries[url] = JSON.parse(this.response);
|
||||
resolve();
|
||||
};
|
||||
|
||||
xhr2.send();
|
||||
onError();
|
||||
}
|
||||
};
|
||||
|
||||
xhr.onerror = onError;
|
||||
|
||||
xhr.send();
|
||||
});
|
||||
}
|
||||
|
@ -67,7 +75,6 @@
|
|||
function setCulture(value) {
|
||||
|
||||
Logger.log('Setting culture to ' + value);
|
||||
|
||||
currentCulture = value;
|
||||
|
||||
return Promise.all([loadDictionary('html', value), loadDictionary('javascript', value)]);
|
||||
|
@ -115,14 +122,11 @@
|
|||
|
||||
Logger.log('Entering Globalize.ensure');
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
return getDeviceCulture().then(function (culture) {
|
||||
|
||||
getDeviceCulture().then(function (culture) {
|
||||
culture = normalizeLocaleName(culture || 'en-US');
|
||||
|
||||
culture = normalizeLocaleName(culture || 'en-US');
|
||||
|
||||
setCulture(culture).then(resolve);
|
||||
});
|
||||
return setCulture(culture);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -76,8 +76,12 @@
|
|||
|
||||
function renderForm(options) {
|
||||
|
||||
require(['paper-checkbox', 'paper-input'], function () {
|
||||
renderFormInternal(options);
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
require(['paper-checkbox', 'paper-input'], function () {
|
||||
renderFormInternal(options);
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -23,8 +23,9 @@
|
|||
dialogOptionsFn: getTargetDialogOptionsFn(dialogOptions),
|
||||
showName: true,
|
||||
readOnlySyncTarget: true
|
||||
}).then(function () {
|
||||
fillJobValues(page, job, dialogOptions);
|
||||
});
|
||||
fillJobValues(page, job, dialogOptions);
|
||||
}
|
||||
|
||||
function getTargetDialogOptionsFn(dialogOptions) {
|
||||
|
@ -267,7 +268,11 @@
|
|||
|
||||
function fillJobValues(page, job, editOptions) {
|
||||
|
||||
$('#txtSyncJobName', page).val(job.Name);
|
||||
var txtSyncJobName = page.querySelector('#txtSyncJobName');
|
||||
if (txtSyncJobName) {
|
||||
txtSyncJobName.value = job.Name;
|
||||
}
|
||||
|
||||
$('#selectProfile', page).val(job.Profile || '').trigger('change');
|
||||
$('#selectQuality', page).val(job.Quality || '').trigger('change');
|
||||
$('#chkUnwatchedOnly', page).checked(job.UnwatchedOnly);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue