From 66d91761ffcecbe88e32c8bd097a2ed11d6449e8 Mon Sep 17 00:00:00 2001 From: Frederic Date: Fri, 13 Sep 2013 16:04:17 +0200 Subject: [PATCH] front-end i18n and german l10n --- cash/locale/de/LC_MESSAGES/django.po | 199 +++++++++++++++++++- cash/templates/cash/base.html | 23 +-- cash/templates/cash/buy_confirm.html | 15 +- cash/templates/cash/buy_error.html | 5 +- cash/templates/cash/buy_thanks.html | 5 +- cash/templates/cash/login.html | 11 +- cash/templates/cash/product_detail.html | 9 +- cash/templates/cash/product_list.html | 11 +- cash/templates/cash/transaction_list.html | 13 +- cash/templates/cash/usersettings.html | 11 +- cash/templates/cash/usersettings_saved.html | 7 +- cash/views.py | 9 +- 12 files changed, 260 insertions(+), 58 deletions(-) diff --git a/cash/locale/de/LC_MESSAGES/django.po b/cash/locale/de/LC_MESSAGES/django.po index d92ec1b..3440d65 100644 --- a/cash/locale/de/LC_MESSAGES/django.po +++ b/cash/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-13 13:21+0200\n" +"POT-Creation-Date: 2013-09-13 16:00+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -51,11 +51,11 @@ msgstr "Autorisiert von %(first)s %(last)s" msgid "card number" msgstr "Kartennummer" -#: models.py:14 +#: models.py:14 views.py:80 msgid "PIN" msgstr "PIN" -#: models.py:15 +#: models.py:15 views.py:76 templates/cash/usersettings.html:10 msgid "daily digest" msgstr "Tägliche Zusammenfassung" @@ -87,7 +87,7 @@ msgstr "Produktkategorie" msgid "product categories" msgstr "Produktkategorien" -#: models.py:97 +#: models.py:97 templates/cash/product_list.html:19 msgid "price" msgstr "Preis" @@ -159,6 +159,195 @@ msgstr "Verkaufsprotokolleinträge" msgid "Cancellation" msgstr "Stornierung" -#: views.py:85 +#: views.py:82 +msgid "PIN (confirmation)" +msgstr "PIN (bestätigen)" + +#: views.py:88 msgid "PINs do not match." msgstr "PINs stimmen nicht überein." + +#: templates/cash/base.html:27 templates/cash/base.html.py:53 +msgid "Overview" +msgstr "Übersicht" + +#: templates/cash/base.html:28 templates/cash/product_list.html:26 +msgid "Buy" +msgstr "Kaufen" + +#: templates/cash/base.html:29 +msgctxt "monthly staement" +msgid "Transaction list" +msgstr "Kontoauszug" + +#: templates/cash/base.html:30 templates/cash/usersettings_saved.html:6 +msgid "Preferences" +msgstr "Einstellungen" + +#: templates/cash/base.html:32 +msgid "Administration" +msgstr "Administration" + +#: templates/cash/base.html:37 +msgid "Logout" +msgstr "Abmelden" + +#: templates/cash/base.html:55 +#, python-format +msgid "Welcome, %(firstname)s!" +msgstr "Herzlich willkommen, %(firstname)s!" + +#: templates/cash/base.html:62 templates/cash/login.html:23 +msgid "Username" +msgstr "Benutzername" + +#: templates/cash/base.html:64 +msgid "Credit" +msgstr "Guthaben" + +#: templates/cash/base.html:67 +msgid "Warning!" +msgstr "Achtung!" + +#: templates/cash/base.html:67 +#, python-format +msgid "Only %(debtlimitamount)s € until reaching the debt limit." +msgstr "" +"Nur noch %(debtlimitamount)s € bis zum Erreichen des " +"Schuldenlimits." + +#: templates/cash/buy_confirm.html:8 templates/cash/buy_error.html:8 +#: templates/cash/buy_thanks.html:8 +msgid "Buy product" +msgstr "Produkt kaufen" + +#: templates/cash/buy_confirm.html:11 templates/cash/product_detail.html:11 +#: templates/cash/product_list.html:19 +msgid "Name" +msgstr "Name" + +#: templates/cash/buy_confirm.html:12 templates/cash/product_detail.html:12 +msgid "Price" +msgstr "Preis" + +#: templates/cash/buy_confirm.html:13 templates/cash/product_detail.html:13 +#: templates/cash/product_list.html:8 +msgid "Category" +msgstr "Kategorie" + +#: templates/cash/buy_confirm.html:16 +msgid "Do you really want to buy this product?" +msgstr "Möchtest du dieses Produkt wirklich kaufen?" + +#: templates/cash/buy_confirm.html:17 +msgid "Yes" +msgstr "Ja" + +#: templates/cash/buy_confirm.html:18 +msgid "No" +msgstr "Nein" + +#: templates/cash/buy_error.html:10 +msgid "You cannot buy this product, as the debt limit has been reached." +msgstr "" +"Du kannst dieses Produkt nicht kaufen, da das Schuldenlimit erreicht wurde." + +#: templates/cash/buy_thanks.html:10 +msgid "Thanks for your purchase!" +msgstr "Danke für deinen Einkauf." + +#: templates/cash/login.html:22 +msgid "Please sign in" +msgstr "Bitte anmelden." + +#: templates/cash/login.html:24 +msgid "Password" +msgstr "Passwort" + +#: templates/cash/login.html:26 +msgctxt "login" +msgid "Remember me" +msgstr "Angemeldet bleiben" + +#: templates/cash/login.html:28 +msgid "Sign in" +msgstr "Anmelden" + +#: templates/cash/product_detail.html:8 +msgid "Product details" +msgstr "Produktdetails" + +#: templates/cash/product_list.html:10 +msgid "All categories" +msgstr "Alle Kategorien" + +#: templates/cash/product_list.html:19 +msgid "Actions" +msgstr "Aktionen" + +#: templates/cash/product_list.html:27 +msgid "Details" +msgstr "Details" + +#: templates/cash/transaction_list.html:7 +msgctxt "monthly statement" +msgid "Transaction list" +msgstr "Kontoauszug" + +#: templates/cash/transaction_list.html:12 +msgid "less detailed" +msgstr "weniger Details" + +#: templates/cash/transaction_list.html:14 +msgid "more detailed" +msgstr "mehr Details" + +#: templates/cash/transaction_list.html:20 +msgid "Date" +msgstr "Datum" + +#: templates/cash/transaction_list.html:20 +msgid "Subject" +msgstr "Betreff" + +#: templates/cash/transaction_list.html:20 +msgctxt "money" +msgid "amount" +msgstr "Betrag" + +#: templates/cash/transaction_list.html:33 +#, python-format +msgid "Page %(current)s of %(num)s" +msgstr "Seite %(current)s von %(num)s" + +#: templates/cash/transaction_list.html:39 +msgid "No transactions have been made, yet." +msgstr "Es wurden noch keine Transaktionen durchgeführt." + +#: templates/cash/usersettings.html:11 +msgid "" +"The digest will be sent nightly, as long as there were transaction made in " +"the past 24 hours." +msgstr "" +"Der Kontoauszug wird nachts versandt, sofern in den vergangenen 24 Stunden " +"Kontobewegungen stattgefunden haben." + +#: templates/cash/usersettings.html:15 templates/cash/usersettings.html:25 +msgid "Save" +msgstr "" + +#: templates/cash/usersettings.html:21 +msgid "" +"The PIN is asked for after scanning the member's ID card. If this field is " +"left blank, no PIN will be needed to log in." +msgstr "" +"Der PIN wird nach dem Einscannen des Mitgliederausweises abgefragt. Wenn das " +"Feld leergelassen wird, wird kein PIN abgefragt." + +#: templates/cash/usersettings_saved.html:7 +msgid "The settings have been saved successfully!" +msgstr "Die Einstellungen wurden erfolgreich gespeichert." + +#: templates/cash/usersettings_saved.html:9 +msgid "Back" +msgstr "Zurück" diff --git a/cash/templates/cash/base.html b/cash/templates/cash/base.html index b5cdb05..dad0bd2 100644 --- a/cash/templates/cash/base.html +++ b/cash/templates/cash/base.html @@ -1,5 +1,6 @@ {% load staticfiles %} {% load url from future %} +{% load i18n %} @@ -23,17 +24,17 @@ @@ -49,21 +50,21 @@
{% block content %} -

Übersicht

+

{% trans "Overview" %}

- Herzlich willkommen, {{ user.first_name }}! + {% blocktrans with firstname=user.first_name %}Welcome, {{ firstname }}!{% endblocktrans %} {% endblock %}
- Username: + {% trans "Username" %}: {{ user.username }}
- Guthaben: + {% trans "Credit" %}: {{ user.account.credit|floatformat:2 }} €
{% if user.account.credit|add:"35" < 5 %} - Achtung!
Nur noch {{ user.account.credit|add:"35"|floatformat:2 }} € bis zum Schuldenlimit.
+ {% trans "Warning!" %}
{% blocktrans with debtlimitamount=user.account.credit|add:"35"|floatformat:2 %}Only {{ debtlimitamount }} € until reaching the debt limit.{% endblocktrans %}
{% endif %}
diff --git a/cash/templates/cash/buy_confirm.html b/cash/templates/cash/buy_confirm.html index 0307d3e..ad9d320 100644 --- a/cash/templates/cash/buy_confirm.html +++ b/cash/templates/cash/buy_confirm.html @@ -1,20 +1,21 @@ {% extends "cash/base.html" %} {% load url from future %} +{% load i18n %} {% block content %} -

Produkt kaufen

+

{% trans "Buy product" %}

- - - + + +
Name:{{ product.name }}
Preis:{{ product.price }}
Kategorie:{{ product.category }}
{% trans "Name" %}:{{ product.name }}
{% trans "Price" %}:{{ product.price }}
{% trans "Category" %}:{{ product.category }}
-

Möchten Sie dieses Produkt wirklich kaufen?

-Ja -Nein +

{% blocktrans %}Do you really want to buy this product?{% endblocktrans %}

+{% trans "Yes" %} +{% trans "No" %} diff --git a/cash/templates/cash/buy_error.html b/cash/templates/cash/buy_error.html index d5b3fb9..8564fd4 100644 --- a/cash/templates/cash/buy_error.html +++ b/cash/templates/cash/buy_error.html @@ -1,11 +1,12 @@ {% extends "cash/base.html" %} {% load url from future %} +{% load i18n %} {% block content %} -

Produkt kaufen

+

{% trans "Buy product" %}

-Du kannst dieses Produkt nicht kaufen, da du das Schuldenlimit erreicht hast. +{% blocktrans %}You cannot buy this product, as the debt limit has been reached.{% endblocktrans %} {% endblock %} diff --git a/cash/templates/cash/buy_thanks.html b/cash/templates/cash/buy_thanks.html index 3f8df39..bb98b2d 100644 --- a/cash/templates/cash/buy_thanks.html +++ b/cash/templates/cash/buy_thanks.html @@ -1,12 +1,13 @@ {% extends "cash/base.html" %} {% load url from future %} +{% load i18n %} {% block content %} -

Produkt kaufen

+

{% trans "Buy product" %}

-Vielen Dank fuer Ihren Einkauf! +{% blocktrans %}Thanks for your purchase!{% endblocktrans %} {% endblock %} diff --git a/cash/templates/cash/login.html b/cash/templates/cash/login.html index f160c8e..a17d543 100644 --- a/cash/templates/cash/login.html +++ b/cash/templates/cash/login.html @@ -1,3 +1,4 @@ +{% load i18n %} @@ -18,13 +19,13 @@ diff --git a/cash/templates/cash/product_detail.html b/cash/templates/cash/product_detail.html index 1801bed..28e2027 100644 --- a/cash/templates/cash/product_detail.html +++ b/cash/templates/cash/product_detail.html @@ -1,15 +1,16 @@ {% extends "cash/base.html" %} {% load url from future %} +{% load i18n %} {% block content %} -

Produktdetails

+

{% trans "Product details" %}

- - - + + +
Name:{{ product.name }}
Preis:{{ product.price }}
Kategorie:{{ product.category }}
{% trans "Name" %}:{{ product.name }}
{% trans "Price" %}:{{ product.price }}
{% trans "Category" %}:{{ product.category }}
{% endblock %} diff --git a/cash/templates/cash/product_list.html b/cash/templates/cash/product_list.html index 4c3c725..7aa92aa 100644 --- a/cash/templates/cash/product_list.html +++ b/cash/templates/cash/product_list.html @@ -1,12 +1,13 @@ {% extends "cash/base.html" %} {% load url from future %} +{% load i18n %} {% block content %} -Kategorie: +{% trans "Category" %}:
    -
  • Alle Kategorien
  • +
  • {% trans "All categories" %}
  • {% for c in categories %}
  • {{ c.name }}
  • {% endfor %} @@ -15,15 +16,15 @@ Kategorie: - + {% for p in product_list %} {% endfor %} diff --git a/cash/templates/cash/transaction_list.html b/cash/templates/cash/transaction_list.html index 4c93d8e..7889dbe 100644 --- a/cash/templates/cash/transaction_list.html +++ b/cash/templates/cash/transaction_list.html @@ -1,22 +1,23 @@ {% extends "cash/base.html" %} {% load url from future %} +{% load i18n %} {% block content %} -

    Kontoauszug

    +

    {% trans "Transaction list" context "monthly statement" %}

    {% if transaction_list %} {% if detailed %} -weniger Details +{% trans "less detailed" %} {% else %} -mehr Details +{% trans "more detailed" %} {% endif %}
    NamePreisAktionen
    {% trans "Name" %}{% trans "price" %}{% trans "Actions" %}
    {{ p.name }} {{ p.price|floatformat:2 }} € - Kaufen - Details + {% trans "Buy" %} + {% trans "Details" %}
    - + {% for t in transaction_list %} @@ -29,13 +30,13 @@
    • «
    • -
    • Seite {{ transaction_list.number }} von {{ transaction_list.paginator.num_pages }}
    • +
    • {% blocktrans with current=transaction_list.number num=transaction_list.paginator.num_pages %}Page {{ current }} of {{ num }}{% endblocktrans %}
    • »
    {% else %} -Es wurden noch keine Transaktionen durchgeführt. +{% blocktrans %}No transactions have been made, yet.{% endblocktrans %} {% endif %} {% endblock %} diff --git a/cash/templates/cash/usersettings.html b/cash/templates/cash/usersettings.html index 9bbf4d1..9e51d2a 100644 --- a/cash/templates/cash/usersettings.html +++ b/cash/templates/cash/usersettings.html @@ -1,27 +1,28 @@ {% extends "cash/base.html" %} {% load url from future %} +{% load i18n %} {% load bootstrap %} {% block content %}

    Einstellungen

    -

    Täglicher Kontoauszug

    -

    Der Kontoauszug wird nachts versandt, sofern in den vergangenen 24 Stunden Kontobewegungen stattgefunden haben.

    +

    {% trans "daily digest" %}

    +

    {% blocktrans %}The digest will be sent nightly, as long as there were transaction made in the past 24 hours.{% endblocktrans %}
    {% csrf_token %} {{ settings_form|bootstrap }} - +


    PIN ändern

    -

    Der PIN wird nach dem Einscannen des Mitgliederausweises abgefragt. Wenn das Feld leergelassen wird, wird kein PIN abgefragt.

    +

    {% blocktrans %}The PIN is asked for after scanning the member's ID card. If this field is left blank, no PIN will be needed to log in.{% endblocktrans %}

    {% csrf_token %} {{ pin_form|bootstrap }} - + diff --git a/cash/templates/cash/usersettings_saved.html b/cash/templates/cash/usersettings_saved.html index b9f0cfe..cdea191 100644 --- a/cash/templates/cash/usersettings_saved.html +++ b/cash/templates/cash/usersettings_saved.html @@ -1,9 +1,10 @@ {% extends "cash/base.html" %} {% load url from future %} +{% load i18n %} {% block content %} -

    Einstellungen

    -Die Einstellungen wurden erfolgreich gespeichert.
    +

    {% trans "Preferences" %}

    +{% blocktrans %}The settings have been saved successfully!{% endblocktrans %}

    -Zurück +{% trans "Back" %} {% endblock %} diff --git a/cash/views.py b/cash/views.py index ec2e49a..de0bb1d 100644 --- a/cash/views.py +++ b/cash/views.py @@ -6,6 +6,7 @@ from django.template import RequestContext from django.core import paginator from cash.models import * from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy @login_required def overview(request): @@ -72,11 +73,13 @@ def buy(request, product_id, confirm=False): context_instance=context) class UserSettingsForm(forms.Form): - daily_digest = forms.BooleanField(required=False) + daily_digest = forms.BooleanField(required=False, label=_('daily digest')) class UserPinForm(forms.Form): - pin = forms.CharField(max_length=32, widget=forms.PasswordInput) - pin_confirm = forms.CharField(max_length=32, widget=forms.PasswordInput) + pin = forms.CharField(max_length=32, widget=forms.PasswordInput, + label=ugettext_lazy('PIN')) + pin_confirm = forms.CharField(max_length=32, widget=forms.PasswordInput, + label=ugettext_lazy('PIN (confirmation)')) def clean(self): cleaned_data = super(UserPinForm, self).clean()
    DatumBetreffBetrag
    {% trans "Date" %}{% trans "Subject" %}{% trans "amount" context "money" %}