Protect against main javascript being loaded before translations

This commit is contained in:
Raphael Michel
2019-07-10 14:31:49 +02:00
parent 22ce7a388d
commit eaf6da7272

View File

@@ -1,5 +1,19 @@
/*global $,gettext*/
function gettext(msgid) {
if (typeof django !== 'undefined' && typeof django.gettext !== 'undefined') {
return django.gettext(msgid);
}
return msgid;
}
function ngettext(singular, plural, count) {
if (typeof django !== 'undefined' && typeof django.ngettext !== 'undefined') {
return django.ngettext(singular, plural, count);
}
return plural;
}
var waitingDialog = {
show: function (message) {
"use strict";