From a28234f82663cda49f61831c26a75a821d3ca91c Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Sat, 3 Mar 2018 21:06:14 +0100 Subject: [PATCH] Add translation --- .../locale/de/LC_MESSAGES/django.po | 29 +++++++++++++++++-- .../locale/de_Informal/LC_MESSAGES/django.po | 29 +++++++++++++++++-- pretix_servicefees/signals.py | 12 +++++++- 3 files changed, 65 insertions(+), 5 deletions(-) diff --git a/pretix_servicefees/locale/de/LC_MESSAGES/django.po b/pretix_servicefees/locale/de/LC_MESSAGES/django.po index b136a10..04c7243 100644 --- a/pretix_servicefees/locale/de/LC_MESSAGES/django.po +++ b/pretix_servicefees/locale/de/LC_MESSAGES/django.po @@ -2,11 +2,36 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-07 19:01+0100\n" +"POT-Creation-Date: 2018-03-03 21:23+0100\n" "PO-Revision-Date: \n" -"Last-Translator: Raphael Michel\n" +"Last-Translator: Raphael Michel \n" "Language-Team: \n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.0.6\n" + +#: pretix_servicefees/__init__.py:10 +msgid "pretix Service Fees" +msgstr "pretix Servicegebühren" + +#: pretix_servicefees/__init__.py:12 +msgid "Allows you to impose a service fee on all non-free orders." +msgstr "Erlaubt Ihnen, eine Servicegebühr für alle Bestellungen zu verlangen." + +#: pretix_servicefees/signals.py:19 +msgid "Service Fee" +msgstr "Servicegebühr" + +#: pretix_servicefees/signals.py:68 +msgid "A service fee of {} will be added on top of each order." +msgstr "Alle Preise zzgl. einer Servicegebühr von {} pro Bestellung." + +#: pretix_servicefees/templates/pretix_servicefees/settings.html:9 +msgid "Service fees" +msgstr "Servicegebühren" + +#: pretix_servicefees/templates/pretix_servicefees/settings.html:14 +msgid "Save" +msgstr "Speichern" diff --git a/pretix_servicefees/locale/de_Informal/LC_MESSAGES/django.po b/pretix_servicefees/locale/de_Informal/LC_MESSAGES/django.po index b136a10..0929bb5 100644 --- a/pretix_servicefees/locale/de_Informal/LC_MESSAGES/django.po +++ b/pretix_servicefees/locale/de_Informal/LC_MESSAGES/django.po @@ -2,11 +2,36 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-07 19:01+0100\n" +"POT-Creation-Date: 2018-03-03 21:23+0100\n" "PO-Revision-Date: \n" -"Last-Translator: Raphael Michel\n" +"Last-Translator: Raphael Michel \n" "Language-Team: \n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.0.6\n" + +#: pretix_servicefees/__init__.py:10 +msgid "pretix Service Fees" +msgstr "pretix Servicegebühren" + +#: pretix_servicefees/__init__.py:12 +msgid "Allows you to impose a service fee on all non-free orders." +msgstr "Erlaubt dir, eine Servicegebühr für alle Bestellungen zu verlangen." + +#: pretix_servicefees/signals.py:19 +msgid "Service Fee" +msgstr "Servicegebühr" + +#: pretix_servicefees/signals.py:68 +msgid "A service fee of {} will be added on top of each order." +msgstr "Alle Preise zzgl. einer Servicegebühr von {} pro Bestellung." + +#: pretix_servicefees/templates/pretix_servicefees/settings.html:9 +msgid "Service fees" +msgstr "Servicegebühren" + +#: pretix_servicefees/templates/pretix_servicefees/settings.html:14 +msgid "Save" +msgstr "Speichern" diff --git a/pretix_servicefees/signals.py b/pretix_servicefees/signals.py index dcc2c01..8a02d74 100644 --- a/pretix_servicefees/signals.py +++ b/pretix_servicefees/signals.py @@ -7,8 +7,9 @@ from django.utils.translation import ugettext_lazy as _ from pretix.base.models import Event, Order, TaxRule from pretix.base.models.orders import OrderFee from pretix.base.signals import order_fee_calculation +from pretix.base.templatetags.money import money_filter from pretix.control.signals import nav_event_settings -from pretix.presale.signals import fee_calculation_for_cart +from pretix.presale.signals import fee_calculation_for_cart, front_page_top @receiver(nav_event_settings, dispatch_uid='service_fee_nav_settings') @@ -58,3 +59,12 @@ def cart_fee(sender: Event, request: HttpRequest, invoice_address, total, **kwar @receiver(order_fee_calculation, dispatch_uid="service_fee_calc_order") def order_fee(sender: Event, invoice_address, total, **kwargs): return get_fees(sender, total, invoice_address) + + +@receiver(front_page_top, dispatch_uid="service_fee_front_page_top") +def front_page_top_recv(sender: Event, **kwargs): + fee = sender.settings.get('service_fee_abs', as_type=Decimal) + if fee: + return '

%s

' % _('A service fee of {} will be added on top of each order.'.format( + money_filter(fee, sender.currency) + ))