summaryrefslogtreecommitdiff
path: root/talermerchantdemos/donations/donations.py
diff options
context:
space:
mode:
Diffstat (limited to 'talermerchantdemos/donations/donations.py')
-rw-r--r--talermerchantdemos/donations/donations.py16
1 files changed, 1 insertions, 15 deletions
diff --git a/talermerchantdemos/donations/donations.py b/talermerchantdemos/donations/donations.py
index 903952c..fa2b077 100644
--- a/talermerchantdemos/donations/donations.py
+++ b/talermerchantdemos/donations/donations.py
@@ -64,6 +64,7 @@ BABEL_TRANSLATION_DIRECTORIES = "../translations"
app.config.from_object(__name__)
babel = Babel(app)
+babel.localeselector(get_locale)
LOGGER.info("Using translations from:" + ":".join(list(babel.translation_directories)))
@@ -74,21 +75,6 @@ LOGGER.info(
"Operating with the following translations available: " + " ".join(translations)
)
-app.add_template_global(self_localized)
-
-
-@babel.localeselector
-def get_locale():
- parts = request.path.split("/", 2)
- if 2 >= len(parts):
- # Totally unexpected path format, do not localize
- return "en"
- lang = parts[1]
- if lang in translations:
- return lang
- return "en"
-
-
# Add context processor that will make additional variables
# and functions available in the template.
app.context_processor(make_utility_processor("donations"))