mirror of
https://github.com/pretix/pretix.git
synced 2025-12-14 13:32:28 +00:00
Compare commits
1 Commits
img-srcset
...
gettextstu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9acbf6ee0d |
@@ -35,6 +35,7 @@
|
|||||||
<script type="text/javascript" src="{% static "clipboard/clipboard.js" %}"></script>
|
<script type="text/javascript" src="{% static "clipboard/clipboard.js" %}"></script>
|
||||||
<script type="text/javascript" src="{% static "cropper/cropper.js" %}"></script>
|
<script type="text/javascript" src="{% static "cropper/cropper.js" %}"></script>
|
||||||
<script type="text/javascript" src="{% static "rrule/rrule.js" %}"></script>
|
<script type="text/javascript" src="{% static "rrule/rrule.js" %}"></script>
|
||||||
|
<script type="text/javascript" src="{% static "pretixbase/js/gettextstub.js" %}"></script>
|
||||||
<script type="text/javascript" src="{% static "pretixpresale/js/ui/questions.js" %}"></script>
|
<script type="text/javascript" src="{% static "pretixpresale/js/ui/questions.js" %}"></script>
|
||||||
<script type="text/javascript" src="{% static "pretixcontrol/js/jquery.qrcode.min.js" %}"></script>
|
<script type="text/javascript" src="{% static "pretixcontrol/js/jquery.qrcode.min.js" %}"></script>
|
||||||
<script type="text/javascript" src="{% static "pretixcontrol/js/clipboard.js" %}"></script>
|
<script type="text/javascript" src="{% static "pretixcontrol/js/clipboard.js" %}"></script>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
<script type="text/javascript" src="{% static "datetimepicker/bootstrap-datetimepicker.js" %}"></script>
|
<script type="text/javascript" src="{% static "datetimepicker/bootstrap-datetimepicker.js" %}"></script>
|
||||||
<script type="text/javascript" src="{% static "slider/bootstrap-slider.js" %}"></script>
|
<script type="text/javascript" src="{% static "slider/bootstrap-slider.js" %}"></script>
|
||||||
<script type="text/javascript" src="{% static "cropper/cropper.js" %}"></script>
|
<script type="text/javascript" src="{% static "cropper/cropper.js" %}"></script>
|
||||||
|
<script type="text/javascript" src="{% static "pretixbase/js/gettextstub.js" %}"></script>
|
||||||
<script type="text/javascript" src="{% static "pretixbase/js/details.js" %}"></script>
|
<script type="text/javascript" src="{% static "pretixbase/js/details.js" %}"></script>
|
||||||
<script type="text/javascript" src="{% static "pretixcontrol/js/jquery.qrcode.min.js" %}"></script>
|
<script type="text/javascript" src="{% static "pretixcontrol/js/jquery.qrcode.min.js" %}"></script>
|
||||||
<script type="text/javascript" src="{% static "pretixpresale/js/widget/floatformat.js" %}"></script>
|
<script type="text/javascript" src="{% static "pretixpresale/js/widget/floatformat.js" %}"></script>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/*global $, waitingDialog, gettext */
|
/*global $, gettext */
|
||||||
var async_task_id = null;
|
var async_task_id = null;
|
||||||
var async_task_timeout = null;
|
var async_task_timeout = null;
|
||||||
var async_task_check_url = null;
|
var async_task_check_url = null;
|
||||||
|
|||||||
23
src/pretix/static/pretixbase/js/gettextstub.js
Normal file
23
src/pretix/static/pretixbase/js/gettextstub.js
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
// The actual gettext implementation is loaded asynchronously with the translation
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
function interpolate(fmt, object, named) {
|
||||||
|
if (named) {
|
||||||
|
return fmt.replace(/%\(\w+\)s/g, function(match){return String(obj[match.slice(2,-2)])});
|
||||||
|
} else {
|
||||||
|
return fmt.replace(/%s/g, function(match){return String(obj.shift())});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,18 +1,4 @@
|
|||||||
/*global $,gettext*/
|
/*global $, gettext, ngettext, interpolate */
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
function formatPrice(price, currency, locale) {
|
function formatPrice(price, currency, locale) {
|
||||||
if (!window.Intl || !Intl.NumberFormat) return price;
|
if (!window.Intl || !Intl.NumberFormat) return price;
|
||||||
|
|||||||
@@ -1,26 +1,4 @@
|
|||||||
/*global $ */
|
/*global $, gettext, ngettext, interpolate */
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
function interpolate(fmt, object, named) {
|
|
||||||
if (named) {
|
|
||||||
return fmt.replace(/%\(\w+\)s/g, function(match){return String(obj[match.slice(2,-2)])});
|
|
||||||
} else {
|
|
||||||
return fmt.replace(/%s/g, function(match){return String(obj.shift())});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var form_handlers = function (el) {
|
var form_handlers = function (el) {
|
||||||
el.find('input, select, textarea').on('invalid', function (e) {
|
el.find('input, select, textarea').on('invalid', function (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user