diff --git a/pretix_servicefees/__init__.py b/pretix_servicefees/__init__.py index 2abdd22..217553c 100644 --- a/pretix_servicefees/__init__.py +++ b/pretix_servicefees/__init__.py @@ -1,5 +1,5 @@ from django.apps import AppConfig -from django.utils.translation import ugettext_lazy +from django.utils.translation import gettext_lazy class PluginApp(AppConfig): @@ -7,10 +7,10 @@ class PluginApp(AppConfig): verbose_name = 'Service Fees' class PretixPluginMeta: - name = ugettext_lazy('Service Fees') + name = gettext_lazy('Service Fees') author = 'Raphael Michel' category = 'FEATURE' - description = ugettext_lazy('This plugin allows to charge a service fee on all non-free orders.') + description = gettext_lazy('This plugin allows to charge a service fee on all non-free orders.') visible = True version = '1.3.2' diff --git a/pretix_servicefees/signals.py b/pretix_servicefees/signals.py index 0eb426a..dee8fa8 100644 --- a/pretix_servicefees/signals.py +++ b/pretix_servicefees/signals.py @@ -3,7 +3,7 @@ from decimal import Decimal from django.urls import resolve, reverse from django.dispatch import receiver from django.http import HttpRequest -from django.utils.translation import ugettext_lazy as _, ugettext, get_language +from django.utils.translation import gettext_lazy as _, gettext, get_language from pretix.base.decimal import round_decimal from pretix.base.models import Event, Order, TaxRule from pretix.base.models.orders import OrderFee @@ -103,19 +103,19 @@ def front_page_top_recv(sender: Event, **kwargs): fees = [] fee_per_ticket = sender.settings.get('service_fee_per_ticket', as_type=Decimal) if fee_per_ticket: - fees = fees + ["{} {}".format(money_filter(fee_per_ticket, sender.currency), ugettext('per ticket'))] + fees = fees + ["{} {}".format(money_filter(fee_per_ticket, sender.currency), gettext('per ticket'))] fee_abs = sender.settings.get('service_fee_abs', as_type=Decimal) if fee_abs: - fees = fees + ["{} {}".format(money_filter(fee_abs, sender.currency), ugettext('per order'))] + fees = fees + ["{} {}".format(money_filter(fee_abs, sender.currency), gettext('per order'))] fee_percent = sender.settings.get('service_fee_percent', as_type=Decimal) if fee_percent: - fees = fees + ['{} % {}'.format(fee_percent, ugettext('per order'))] + fees = fees + ['{} % {}'.format(fee_percent, gettext('per order'))] if fee_per_ticket or fee_abs or fee_percent: - return '
%s
' % ugettext('A service fee of {} will be added on top of each order.').format( - ' {} '.format(ugettext('plus')).join(fees) + return '%s
' % gettext('A service fee of {} will be added on top of each order.').format( + ' {} '.format(gettext('plus')).join(fees) ) diff --git a/pretix_servicefees/views.py b/pretix_servicefees/views.py index a2567e6..67d4c84 100644 --- a/pretix_servicefees/views.py +++ b/pretix_servicefees/views.py @@ -1,6 +1,6 @@ from django import forms from django.urls import reverse -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from pretix.base.forms import SettingsForm from pretix.base.models import Event