forked from CGM_Public/pretix_original
asynctask.js: Fix gettext being used before translations are loaded (Z#23204825) (#5401)
This commit is contained in:
@@ -8,15 +8,16 @@ var async_task_is_long = false;
|
|||||||
var async_task_dont_redirect = false;
|
var async_task_dont_redirect = false;
|
||||||
|
|
||||||
var async_task_status_messages = {
|
var async_task_status_messages = {
|
||||||
long_task_started: gettext(
|
// These are functions in order to be lazily evaluated after the gettext file is loaded
|
||||||
|
long_task_started: () => gettext(
|
||||||
'Your request is currently being processed. Depending on the size of your event, this might take up to ' +
|
'Your request is currently being processed. Depending on the size of your event, this might take up to ' +
|
||||||
'a few minutes.'
|
'a few minutes.'
|
||||||
),
|
),
|
||||||
long_task_pending: gettext(
|
long_task_pending: () => gettext(
|
||||||
'Your request has been queued on the server and will soon be ' +
|
'Your request has been queued on the server and will soon be ' +
|
||||||
'processed.'
|
'processed.'
|
||||||
),
|
),
|
||||||
short_task: gettext(
|
short_task: () => gettext(
|
||||||
'Your request arrived on the server but we still wait for it to be ' +
|
'Your request arrived on the server but we still wait for it to be ' +
|
||||||
'processed. If this takes longer than two minutes, please contact us or go ' +
|
'processed. If this takes longer than two minutes, please contact us or go ' +
|
||||||
'back in your browser and try again.'
|
'back in your browser and try again.'
|
||||||
@@ -73,12 +74,12 @@ function async_task_check_callback(data, textStatus, jqXHR) {
|
|||||||
function async_task_update_status(data) {
|
function async_task_update_status(data) {
|
||||||
if (async_task_is_long) {
|
if (async_task_is_long) {
|
||||||
if (data.started) {
|
if (data.started) {
|
||||||
waitingDialog.setStatus(async_task_status_messages.long_task_started);
|
waitingDialog.setStatus(async_task_status_messages.long_task_started());
|
||||||
} else {
|
} else {
|
||||||
waitingDialog.setStatus(async_task_status_messages.long_task_pending);
|
waitingDialog.setStatus(async_task_status_messages.long_task_pending());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
waitingDialog.setStatus(async_task_status_messages.short_task);
|
waitingDialog.setStatus(async_task_status_messages.short_task());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user