[ckan-changes] [ckan/ckan] dae200: [#3196] Handle i18n on incoming requests before ap...

GitHub noreply at github.com
Fri May 12 15:38:43 UTC 2017


  Branch: refs/heads/3229-api-blueprint
  Home:   https://github.com/ckan/ckan
  Commit: dae200eea218f08fdc885d2dc240f6eb8725783d
      https://github.com/ckan/ckan/commit/dae200eea218f08fdc885d2dc240f6eb8725783d
  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/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: 398ccc48fd0d1a8802396224d488448bb367ee16
      https://github.com/ckan/ckan/commit/398ccc48fd0d1a8802396224d488448bb367ee16
  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/2d7c28b44a4d...398ccc48fd0d


More information about the ckan-changes mailing list