Browse Source

front-end i18n and german l10n

master
Frederic 11 years ago
parent
commit
66d91761ff
  1. 199
      cash/locale/de/LC_MESSAGES/django.po
  2. 23
      cash/templates/cash/base.html
  3. 15
      cash/templates/cash/buy_confirm.html
  4. 5
      cash/templates/cash/buy_error.html
  5. 5
      cash/templates/cash/buy_thanks.html
  6. 11
      cash/templates/cash/login.html
  7. 9
      cash/templates/cash/product_detail.html
  8. 11
      cash/templates/cash/product_list.html
  9. 13
      cash/templates/cash/transaction_list.html
  10. 11
      cash/templates/cash/usersettings.html
  11. 7
      cash/templates/cash/usersettings_saved.html
  12. 9
      cash/views.py

199
cash/locale/de/LC_MESSAGES/django.po

@ -8,7 +8,7 @@ msgid "" @@ -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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -51,11 +51,11 @@ msgstr "Autorisiert von %(first)s %(last)s" @@ -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" @@ -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" @@ -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&nbsp;&euro; until reaching the debt limit."
msgstr ""
"Nur noch %(debtlimitamount)s&nbsp;&euro; 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"

23
cash/templates/cash/base.html

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
{% load staticfiles %}
{% load url from future %}
{% load i18n %}
<!DOCTYPE html>
<html lang="en">
@ -23,17 +24,17 @@ @@ -23,17 +24,17 @@
</div>
<ul class="nav navbar-nav">
<li><a href="{% url 'overview' %}">Home</a></li>
<li><a href="{% url 'products' %}">Kaufen</a></li>
<li><a href="{% url 'transactions' %}">Kontoauszug</a></li>
<li><a href="{% url 'usersettings' %}">Einstellungen</a></li>
<li><a href="{% url 'overview' %}">{% trans "Overview" %}</a></li>
<li><a href="{% url 'products' %}">{% trans "Buy" %}</a></li>
<li><a href="{% url 'transactions' %}">{% trans "Transaction list" context "monthly staement" %}</a></li>
<li><a href="{% url 'usersettings' %}">{% trans "Preferences" %}</a></li>
{% if user.is_staff %}
<li><a href="/admin/">Administration</a></li>
<li><a href="/admin/">{% trans "Administration" %}</a></li>
{% endif %}
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="{% url 'django.contrib.auth.views.logout_then_login' %}">Logout</a></li>
<li><a href="{% url 'django.contrib.auth.views.logout_then_login' %}">{% trans "Logout" %}</a></li>
</ul>
@ -49,21 +50,21 @@ @@ -49,21 +50,21 @@
<div class="container">
{% block content %}
<h1>Übersicht</h1>
<h1>{% trans "Overview" %}</h1>
<strong>Herzlich willkommen, {{ user.first_name }}!</strong>
<strong>{% blocktrans with firstname=user.first_name %}Welcome, {{ firstname }}!{% endblocktrans %}</strong>
{% endblock %}
</div>
</div>
<div class="col-md-2 well">
<span>Username:</span>
<span>{% trans "Username" %}:</span>
<span><strong>{{ user.username }}</strong></span><br/>
<span>Guthaben:</span>
<span>{% trans "Credit" %}:</span>
<span {% if user.account.credit < 0 %} style="color: red"{% endif %}><b>{{ user.account.credit|floatformat:2 }} &euro;</b></span><br/>
{% if user.account.credit|add:"35" < 5 %}
<span style="color: #FF5252">Achtung!<br/> Nur noch {{ user.account.credit|add:"35"|floatformat:2 }}&nbsp;&euro; bis zum Schuldenlimit.</span>
<span style="color: #FF5252">{% trans "Warning!" %}<br/>{% blocktrans with debtlimitamount=user.account.credit|add:"35"|floatformat:2 %}Only {{ debtlimitamount }}&nbsp;&euro; until reaching the debt limit.{% endblocktrans %}</span>
{% endif %}
</div>
</div>

15
cash/templates/cash/buy_confirm.html

@ -1,20 +1,21 @@ @@ -1,20 +1,21 @@
{% extends "cash/base.html" %}
{% load url from future %}
{% load i18n %}
{% block content %}
<h1>Produkt kaufen</h1>
<h1>{% trans "Buy product" %}</h1>
<table>
<tr><th>Name:</th><td>{{ product.name }}</td></tr>
<tr><th>Preis:</th><td>{{ product.price }}</td></tr>
<tr><th>Kategorie:</th><td>{{ product.category }}</td></tr>
<tr><th>{% trans "Name" %}:</th><td>{{ product.name }}</td></tr>
<tr><th>{% trans "Price" %}:</th><td>{{ product.price }}</td></tr>
<tr><th>{% trans "Category" %}:</th><td>{{ product.category }}</td></tr>
</table>
<p>Möchten Sie dieses Produkt wirklich kaufen?</p>
<a class="btn btn-default" href="{% url 'buy_really' product.id %}">Ja</a>
<a class="btn btn-default" href="{% url 'products' %}">Nein</a>
<p>{% blocktrans %}Do you really want to buy this product?{% endblocktrans %}</p>
<a class="btn btn-default" href="{% url 'buy_really' product.id %}">{% trans "Yes" %}</a>
<a class="btn btn-default" href="{% url 'products' %}">{% trans "No" %}</a>

5
cash/templates/cash/buy_error.html

@ -1,11 +1,12 @@ @@ -1,11 +1,12 @@
{% extends "cash/base.html" %}
{% load url from future %}
{% load i18n %}
{% block content %}
<h1>Produkt kaufen</h1>
<h1>{% trans "Buy product" %}</h1>
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 %}

5
cash/templates/cash/buy_thanks.html

@ -1,12 +1,13 @@ @@ -1,12 +1,13 @@
{% extends "cash/base.html" %}
{% load url from future %}
{% load i18n %}
{% block content %}
<h1>Produkt kaufen</h1>
<h1>{% trans "Buy product" %}</h1>
Vielen Dank fuer Ihren Einkauf!
{% blocktrans %}Thanks for your purchase!{% endblocktrans %}
{% endblock %}

11
cash/templates/cash/login.html

@ -1,3 +1,4 @@ @@ -1,3 +1,4 @@
{% load i18n %}
<!DOCTYPE html>
<html lang="en">
<head>
@ -18,13 +19,13 @@ @@ -18,13 +19,13 @@
<form class="form-signin" method="post" action="{% url 'django.contrib.auth.views.login' %}">
{% csrf_token %}
<input type="hidden" name="next" value="{{ next }}" />
<h2 class="form-signin-heading">Please sign in</h2>
<input type="text" name="username" class="form-control" placeholder="Username" autofocus>
<input type="password" name="password" class="form-control" placeholder="Password">
<h2 class="form-signin-heading">{% trans "Please sign in" %}</h2>
<input type="text" name="username" class="form-control" placeholder="{% trans "Username" %}" autofocus>
<input type="password" name="password" class="form-control" placeholder="{% trans "Password" %}">
<label class="checkbox">
<input type="checkbox" value="remember-me"> Remember me
<input type="checkbox" value="remember-me"> {% trans "Remember me" context "login" %}
</label>
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
<button class="btn btn-lg btn-primary btn-block" type="submit">{% trans "Sign in" %}</button>
</form>
</div> <!-- /container -->

9
cash/templates/cash/product_detail.html

@ -1,15 +1,16 @@ @@ -1,15 +1,16 @@
{% extends "cash/base.html" %}
{% load url from future %}
{% load i18n %}
{% block content %}
<h1>Produktdetails</h1>
<h1>{% trans "Product details" %}</h1>
<table>
<tr><th>Name:</th><td>{{ product.name }}</td></tr>
<tr><th>Preis:</th><td>{{ product.price }}</td></tr>
<tr><th>Kategorie:</th><td>{{ product.category }}</td></tr>
<tr><th>{% trans "Name" %}:</th><td>{{ product.name }}</td></tr>
<tr><th>{% trans "Price" %}:</th><td>{{ product.price }}</td></tr>
<tr><th>{% trans "Category" %}:</th><td>{{ product.category }}</td></tr>
</table>
{% endblock %}

11
cash/templates/cash/product_list.html

@ -1,12 +1,13 @@ @@ -1,12 +1,13 @@
{% extends "cash/base.html" %}
{% load url from future %}
{% load i18n %}
{% block content %}
Kategorie:
{% trans "Category" %}:
<ul>
<li {% if not category %}style="font-weight: bold"{% endif %}><a href="{% url 'products' %}">Alle Kategorien</a></li>
<li {% if not category %}style="font-weight: bold"{% endif %}><a href="{% url 'products' %}">{% trans "All categories" %}</a></li>
{% for c in categories %}
<li {% if c == category %}style="font-weight: bold"{% endif %}><a href="{% url 'products' %}{{c.id}}">{{ c.name }}</a></li>
{% endfor %}
@ -15,15 +16,15 @@ Kategorie: @@ -15,15 +16,15 @@ Kategorie:
<table>
<thead>
<tr><td>Name</td><td>Preis</td><td>Aktionen</td></tr>
<tr><td>{% trans "Name" %}</td><td>{% trans "price" %}</td><td>{% trans "Actions" %}</td></tr>
</thead>
{% for p in product_list %}
<tr>
<td>{{ p.name }}</td>
<td>{{ p.price|floatformat:2 }} &euro;</td>
<td>
<a class="btn btn-default" href="{% url 'buy' p.id %}">Kaufen</a>
<a class="btn btn-default" href="{% url 'product' p.id %}">Details</a>
<a class="btn btn-default" href="{% url 'buy' p.id %}">{% trans "Buy" %}</a>
<a class="btn btn-default" href="{% url 'product' p.id %}">{% trans "Details" %}</a>
</td>
</tr>
{% endfor %}

13
cash/templates/cash/transaction_list.html

@ -1,22 +1,23 @@ @@ -1,22 +1,23 @@
{% extends "cash/base.html" %}
{% load url from future %}
{% load i18n %}
{% block content %}
<h1>Kontoauszug</h1>
<h1>{% trans "Transaction list" context "monthly statement" %}</h1>
{% if transaction_list %}
{% if detailed %}
<a href="{% url 'transactions' transaction_list.number %}" class="btn btn-default">weniger Details</a>
<a href="{% url 'transactions' transaction_list.number %}" class="btn btn-default">{% trans "less detailed" %}</a>
{% else %}
<a href="{% url 'transactions_detailed' transaction_list.number %}" class="btn btn-default">mehr Details</a>
<a href="{% url 'transactions_detailed' transaction_list.number %}" class="btn btn-default">{% trans "more detailed" %}</a>
{% endif %}
<br/>
<table>
<thead>
<tr><th>Datum</th><th>Betreff</th><th style="text-align: right;">Betrag</th></tr>
<tr><th>{% trans "Date" %}</th><th>{% trans "Subject" %}</th><th style="text-align: right;">{% trans "amount" context "money" %}</th></tr>
</thead>
{% for t in transaction_list %}
<tr>
@ -29,13 +30,13 @@ @@ -29,13 +30,13 @@
<ul class="pagination">
<li {% if not transaction_list.has_previous %}class="disabled"{% endif %}><a href="{% if transaction_list.has_previous %}{% if detailed %}{% url 'transactions_detailed' page=transaction_list.previous_page_number %}{% else %}{% url 'transactions' page=transaction_list.previous_page_number %}{% endif %}{% endif %}">&laquo;</a></li>
<li><span>Seite {{ transaction_list.number }} von {{ transaction_list.paginator.num_pages }}</span></li>
<li><span>{% blocktrans with current=transaction_list.number num=transaction_list.paginator.num_pages %}Page {{ current }} of {{ num }}{% endblocktrans %}</span></li>
<li {% if not transaction_list.has_next %}class="disabled"{% endif %}><a href="{% if transaction_list.has_next %}{% if detailed %}{% url 'transactions_detailed' page=transaction_list.next_page_number %}{% else %}{% url 'transactions' page=transaction_list.next_page_number %}{% endif %}{% endif %}">&raquo;</a></li>
</ul>
{% else %}
Es wurden noch keine Transaktionen durchgeführt.
{% blocktrans %}No transactions have been made, yet.{% endblocktrans %}
{% endif %}
{% endblock %}

11
cash/templates/cash/usersettings.html

@ -1,27 +1,28 @@ @@ -1,27 +1,28 @@
{% extends "cash/base.html" %}
{% load url from future %}
{% load i18n %}
{% load bootstrap %}
{% block content %}
<h1>Einstellungen</h1>
<h2>Täglicher Kontoauszug</h2>
<p>Der Kontoauszug wird nachts versandt, sofern in den vergangenen 24 Stunden Kontobewegungen stattgefunden haben.</p>
<h2>{% trans "daily digest" %}</h2>
<p>{% blocktrans %}The digest will be sent nightly, as long as there were transaction made in the past 24 hours.{% endblocktrans %}
<form action="{% url 'usersettings' %}settings/" method="post">
{% csrf_token %}
{{ settings_form|bootstrap }}
<input type="submit" class="btn btn-default" value="Speichern" />
<input type="submit" class="btn btn-default" value="{% trans "Save" %}" />
</form>
<hr/>
<h2>PIN ändern</h2>
<p>Der PIN wird nach dem Einscannen des Mitgliederausweises abgefragt. Wenn das Feld leergelassen wird, wird kein PIN abgefragt.</p>
<p>{% 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 %}</p>
<form action="{% url 'usersettings' %}pin/" method="post">
{% csrf_token %}
{{ pin_form|bootstrap }}
<input type="submit" class="btn btn-default" value="Speichern" />
<input type="submit" class="btn btn-default" value="{% trans "Save" %}" />
</form>

7
cash/templates/cash/usersettings_saved.html

@ -1,9 +1,10 @@ @@ -1,9 +1,10 @@
{% extends "cash/base.html" %}
{% load url from future %}
{% load i18n %}
{% block content %}
<h1>Einstellungen</h1>
Die Einstellungen wurden erfolgreich gespeichert.<br/>
<h1>{% trans "Preferences" %}</h1>
{% blocktrans %}The settings have been saved successfully!{% endblocktrans %}<br/>
<br/>
<a href="{% url 'usersettings' %}">Zurück</a>
<a href="{% url 'usersettings' %}">{% trans "Back" %}</a>
{% endblock %}

9
cash/views.py

@ -6,6 +6,7 @@ from django.template import RequestContext @@ -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): @@ -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()

Loading…
Cancel
Save