gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-backoffice] branch master updated: Select the langua


From: gnunet
Subject: [GNUnet-SVN] [taler-backoffice] branch master updated: Select the language based on the /<lang>/ URL component.
Date: Tue, 04 Sep 2018 11:55:31 +0200

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

marcello pushed a commit to branch master
in repository backoffice.

The following commit(s) were added to refs/heads/master by this push:
     new c86d414  Select the language based on the /<lang>/ URL component.
c86d414 is described below

commit c86d414cbf792b62dc3b3aa477b81e77b0befda1
Author: Marcello Stanisci <address@hidden>
AuthorDate: Tue Sep 4 11:54:58 2018 +0200

    Select the language based on the /<lang>/ URL component.
---
 talerbackoffice/backoffice/backoffice.py           | 33 ++++++++++------------
 .../backoffice/templates/translations/messages.pot | 30 --------------------
 2 files changed, 15 insertions(+), 48 deletions(-)

diff --git a/talerbackoffice/backoffice/backoffice.py 
b/talerbackoffice/backoffice/backoffice.py
index 5f81602..8b6242b 100644
--- a/talerbackoffice/backoffice/backoffice.py
+++ b/talerbackoffice/backoffice/backoffice.py
@@ -1,16 +1,19 @@
 # This file is part of GNU TALER.
 # Copyright (C) 2014-2017 INRIA
 #
-# TALER is free software; you can redistribute it and/or modify it under the
-# terms of the GNU Lesser General Public License as published by the Free 
Software
-# Foundation; either version 2.1, or (at your option) any later version.
+# TALER is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1,
+# or (at your option) any later version.
 #
-# TALER is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more 
details.
+# TALER is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License for more details.
 #
-# You should have received a copy of the GNU Lesser General Public License 
along with
-# GNU TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+# You should have received a copy of the GNU Lesser General Public
+# License along with GNU TALER; see the file COPYING.  If not, see
+# <http://www.gnu.org/licenses/>
 #
 # @author Florian Dold
 # @author Marcello Stanisci
@@ -60,16 +63,10 @@ LANGUAGES = {
 
 @babel.localeselector
 def get_locale():
-
-  return "it"
-  
-  # BUG: qs is always empty.
-  print("get_locale dead code")
-  qs = get_query_string().decode("utf-8")
-  for token in qs.split("/"):
-    if "" == token:
-      pass
-    return token if token in LANGUAGES.keys() else "en"
+  # If any "lang" component exists in the path, then
+  # it must be at the second position into the split array.
+  lang = flask.request.path.split("/")[1]
+  return lang if lang in LANGUAGES.keys() else "en"
 
 @app.context_processor
 def utility_processor():
diff --git a/talerbackoffice/backoffice/templates/translations/messages.pot 
b/talerbackoffice/backoffice/templates/translations/messages.pot
deleted file mode 100644
index f17b733..0000000
--- a/talerbackoffice/backoffice/templates/translations/messages.pot
+++ /dev/null
@@ -1,30 +0,0 @@
-# Translations template for PROJECT.
-# Copyright (C) 2018 ORGANIZATION
-# This file is distributed under the same license as the PROJECT project.
-# FIRST AUTHOR <address@hidden>, 2018.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"Report-Msgid-Bugs-To: address@hidden"
-"POT-Creation-Date: 2018-09-03 15:35+0200\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <address@hidden>\n"
-"Language-Team: LANGUAGE <address@hidden>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 2.3.4\n"
-
-#: backoffice.html:4
-msgid ""
-"This is the Taler backoffice facility.  Through it,\n"
-"  the user can see the money flow from Taler transactions to\n"
-"  wire transfers and viceversa."
-msgstr ""
-
-#: backoffice.html:14
-msgid "Current instance:"
-msgstr ""
-

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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