mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Update translate.js to use createAjaxRequest
This commit is contained in:
@@ -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.Prowlarr.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.Prowlarr.apiKey;
|
|
||||||
|
|
||||||
$.ajax(ajaxOptions);
|
|
||||||
return localization;
|
return localization;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user