Refactor stubs for gettext JS function (#5170)

This commit is contained in:
Raphael Michel
2025-05-27 17:24:04 +02:00
committed by GitHub
parent 20de9830db
commit 5fb1fc23ce
6 changed files with 28 additions and 39 deletions

View File

@@ -1,18 +1,4 @@
/*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;
}
/*global $, gettext, ngettext, interpolate */
function formatPrice(price, currency, locale) {
if (!window.Intl || !Intl.NumberFormat) return price;