mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 05:23:31 -07:00
Update translate.js to use createAjaxRequest
This commit is contained in:
parent
0abb49cdeb
commit
e6a4711be5
1 changed files with 3 additions and 7 deletions
|
@ -1,22 +1,18 @@
|
||||||
import $ from 'jquery';
|
import createAjaxRequest from 'Utilities/createAjaxRequest';
|
||||||
|
|
||||||
function getTranslations() {
|
function getTranslations() {
|
||||||
let localization = null;
|
let localization = null;
|
||||||
const ajaxOptions = {
|
const ajaxOptions = {
|
||||||
async: false,
|
async: false,
|
||||||
type: 'GET',
|
|
||||||
global: false,
|
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
url: `${window.Lidarr.apiRoot}/localization`,
|
url: '/localization',
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
localization = data.Strings;
|
localization = data.Strings;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ajaxOptions.headers = ajaxOptions.headers || {};
|
createAjaxRequest(ajaxOptions);
|
||||||
ajaxOptions.headers['X-Api-Key'] = window.Lidarr.apiKey;
|
|
||||||
|
|
||||||
$.ajax(ajaxOptions);
|
|
||||||
return localization;
|
return localization;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue