gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-bank] 01/02: more gettext() wrapping


From: gnunet
Subject: [taler-bank] 01/02: more gettext() wrapping
Date: Tue, 20 Oct 2020 11:54:13 +0200

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository bank.

commit 7a3d3b3130e2d1e56d2236c7c82d33b3e461b31d
Author: MS <ms@taler.net>
AuthorDate: Tue Oct 20 11:27:16 2020 +0200

    more gettext() wrapping
---
 talerbank/app/templates/login.html | 29 +++++++++++++++++------------
 talerbank/jinja2.py                |  4 ++--
 2 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/talerbank/app/templates/login.html 
b/talerbank/app/templates/login.html
index c208990..04b792d 100644
--- a/talerbank/app/templates/login.html
+++ b/talerbank/app/templates/login.html
@@ -19,7 +19,7 @@
 #}
 
 {% block headermsg %}
-  <h1 class="nav">Welcome to the {{ settings_value("TALER_CURRENCY") }} 
Bank!</h1>
+  <h1 class="nav"> {{ _("Welcome to the {currency} 
Bank!").format(currency=settings_value("TALER_CURRENCY")) }}</h1>
 {% endblock headermsg %}
 
 {% block content %}
@@ -29,15 +29,19 @@
         <h2>{{ _("Please login!") }}</h2>
 
         {% if form.errors %}
-        <p class="informational informational-fail">Your username and password 
didn't match. Please try again.</p>
+        <p class="informational informational-fail">
+          {{ _("Your username and password didn't match. Please try again.") }}
+        </p>
         {% endif %}
 
         {% if next and next != url('profile') %}
             {% if request.user and request.user.is_authenticated %}
-            <p class="informational informational-fail">Your account doesn't 
have access to this page. To proceed,
-            please login with an account that has access.</p>
+            <p class="informational informational-fail">
+              {{ _("Your account doesn't have access to this page. To proceed, 
please login with an account that has access.") }}</p>
             {% else %}
-            <p class="informational informational-fail">Please login to see 
this page.</p>
+            <p class="informational informational-fail">
+              {{ _("Please login to see this page.") }}
+            </p>
             {% endif %}
         {% endif %}
 
@@ -51,16 +55,17 @@
       </div>
       {% if settings_value("ALLOW_REGISTRATIONS") %}
       <p>
-      If you are a new customer, please <a href="{{ url('register') 
}}">register</a>.
-      Registration is fast and free, and it gives you a registration bonus
-      of 100 {{ settings_value("TALER_CURRENCY") }}!
-      </p>
+        {% autoescape off %}
+        {{ _("If you are a new customer please <a 
href=\"{register_link}\">register</a>.  Registration is fast and free, and it 
gives you a registration bonus of 100 
{currency}").format(register_link=url('register'), 
currency=settings_value("TALER_CURRENCY")) }}
+        {% endautoescape %}
+        </p>
       {% else %}
-      <p>Registrations are not open to the public.</p>
+      <p>{{ _("Registrations are not open to the public.") }}</p>
       {% endif %}
       <p>
-      To view transactions of public accounts,
-      please <a href="{{ url('public-accounts') }}">click here</a>.
+      {% autoescape off %}
+      {{ _("To view transactions of public accounts, please <a 
href=\"{public_accoutns}\">click 
here</a>.").format(public_accounts=url('public-accounts')) }}
+      {% endautoescape %}
       </p>
     </article>
   </section>
diff --git a/talerbank/jinja2.py b/talerbank/jinja2.py
index 0f18f74..9b8d59b 100644
--- a/talerbank/jinja2.py
+++ b/talerbank/jinja2.py
@@ -26,7 +26,7 @@ from urllib.parse import urlparse
 from django.urls import reverse, get_script_prefix
 from django.conf import settings
 from jinja2 import Environment
-from django.utils.translation import ugettext
+from django.utils.translation import gettext
 
 ##
 # Check if a URL is absolute or not.
@@ -140,7 +140,7 @@ def environment(**options):
             "is_valid_amount": is_valid_amount,
             "amount_stringify": amount_stringify,
             "tojson": tojson,
-            "_": ugettext,
+            "_": gettext,
         }
     )
     return env

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]