diff options
author | Marcello Stanisci <stanisci.m@gmail.com> | 2018-07-31 14:44:20 +0200 |
---|---|---|
committer | Marcello Stanisci <stanisci.m@gmail.com> | 2018-07-31 14:44:20 +0200 |
commit | 397462bf4c02ac05f7913e05c5cca0ac7dcf6d4c (patch) | |
tree | a5eb81c66168915f8242b580c305793eaf9efd34 | |
parent | db3430a82b730f6651817780b6079cd69be77913 (diff) | |
download | backoffice-397462bf4c02ac05f7913e05c5cca0ac7dcf6d4c.tar.gz backoffice-397462bf4c02ac05f7913e05c5cca0ac7dcf6d4c.tar.bz2 backoffice-397462bf4c02ac05f7913e05c5cca0ac7dcf6d4c.zip |
Fix babel.map
-rw-r--r-- | talerbackoffice/backoffice/backoffice.py | 7 | ||||
-rw-r--r-- | talerbackoffice/backoffice/templates/Makefile | 2 | ||||
-rw-r--r-- | talerbackoffice/backoffice/templates/translations/babel.map | 11 |
3 files changed, 7 insertions, 13 deletions
diff --git a/talerbackoffice/backoffice/backoffice.py b/talerbackoffice/backoffice/backoffice.py index ce2858e..e828310 100644 --- a/talerbackoffice/backoffice/backoffice.py +++ b/talerbackoffice/backoffice/backoffice.py @@ -26,7 +26,7 @@ import os import base64 import requests import flask -from flask.ext.babel import Babel +from flask_babel import Babel from talerbackoffice.talerconfig import TalerConfig from ..helpers import (join_urlparts, \ get_query_string, backend_error) @@ -80,8 +80,9 @@ def utility_processor(): @app.route("/<lang>/") -@app.route("/") -def index(): +@app.route("/", defaults={"lang": "en"}) +def index(lang): + # 'lang' parameter not used. return flask.render_template("templates/backoffice.html", instances=INSTANCES.split()) @app.route("/javascript") diff --git a/talerbackoffice/backoffice/templates/Makefile b/talerbackoffice/backoffice/templates/Makefile index b25897d..ba531d1 100644 --- a/talerbackoffice/backoffice/templates/Makefile +++ b/talerbackoffice/backoffice/templates/Makefile @@ -7,7 +7,7 @@ all: locale # Extract translateable strings from jinja2 templates. locale/messages.pot: *.html - env PYTHONPATH="." pybabel extract -F translations/babel.map -o translations/messages.pot . + pybabel extract -F translations/babel.map -o translations/messages.pot . # Update translation (.po) files with new strings. locale-update: locale/messages.pot diff --git a/talerbackoffice/backoffice/templates/translations/babel.map b/talerbackoffice/backoffice/templates/translations/babel.map index d596257..609bc8e 100644 --- a/talerbackoffice/backoffice/templates/translations/babel.map +++ b/talerbackoffice/backoffice/templates/translations/babel.map @@ -1,9 +1,2 @@ -[extractors] -jinja2 = i18nfix:babel_extract - -[python: **.py] - -[jinja2: **/templates/**.html] -encoding = utf-8 -lstrip_blocks = True -trim_blocks = True +[jinja2: **.html] +extensions=jinja2.ext.autoescape,jinja2.ext.with_ |