[ckan-changes] [ckan/ckan] 2c2615: [#3196] Handle i18n on incoming requests before ap...
GitHub
noreply at github.com
Fri May 12 15:39:01 UTC 2017
Branch: refs/heads/3196-i18n
Home: https://github.com/ckan/ckan
Commit: 2c2615f362559d05df986621f9c899d6ffcf8ac3
https://github.com/ckan/ckan/commit/2c2615f362559d05df986621f9c899d6ffcf8ac3
Author: amercader <amercadero at gmail.com>
Date: 2017-05-12 (Fri, 12 May 2017)
Changed paths:
M ckan/config/middleware/__init__.py
M ckan/config/middleware/common_middleware.py
M ckan/config/middleware/flask_app.py
M ckan/config/middleware/pylons_app.py
M ckan/tests/config/test_middleware.py
M ckan/tests/lib/test_i18n.py
Log Message:
-----------
[#3196] Handle i18n on incoming requests before app dispatching
The I18nMiddleware strips the locale part of the incoming request URL
(eg '/sk/about' -> '/about'). Right now this was only done after the app
dipatching was done, so when querying the Flask mapper if it could
handle such a request it also returned False (Pylons worked only because
we have the infamous "catch-all" rule).
This handling of the environ needs to be done before the mappers are
called, so I've moved the relevant logic out of its own middleware and
into the main AskAppDispatchMiddleware to simplify things and make it
more explicit.
Added a test that covers translated / untranslated strings for Flask /
Pylons.
Commit: 7f2310920735cc81200431cfb70eaa25e4a8b364
https://github.com/ckan/ckan/commit/7f2310920735cc81200431cfb70eaa25e4a8b364
Author: amercader <amercadero at gmail.com>
Date: 2017-05-12 (Fri, 12 May 2017)
Changed paths:
M ckan/config/middleware/flask_app.py
M requirements.in
M requirements.txt
Log Message:
-----------
[#3196] Upgrade Flask-babel to 0.11.2
To support custom domains
Compare: https://github.com/ckan/ckan/compare/e485af674f76...7f2310920735
More information about the ckan-changes
mailing list