Why different from Django version

When I've looked at  Django version of middleware, few questions arose:

  • how to give somebody link to a specific translation of the page
  • how search engines will know that we have translations?

Etc.

It would be much easier if we can tell which language document is, from URL. For example:

 http://some.site.com/document/en/

That would be English document. And /de/ suffix will make German document.

To make this possible, the following milddleware has been created.

In your settings.py, add the following line to MIDDLEWARE_C:

MIDDLEWARE_CLASSES = (
...
    'utils.locale.HDGLocaleMiddleware',
...
}