mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #22120 -- Documented persistent activation of languages and cleaned up language session key use
This commit is contained in:
committed by
Baptiste Mispelon
parent
09b725f51b
commit
8cd32f0965
@@ -537,11 +537,13 @@ Internationalization
|
||||
attribute allows you to customize the redirects issued by the middleware.
|
||||
|
||||
* The :class:`~django.middleware.locale.LocaleMiddleware` now stores the user's
|
||||
selected language with the session key ``_language``. Previously it was
|
||||
stored with the key ``django_language``, but keys reserved for Django should
|
||||
start with an underscore. For backwards compatibility ``django_language`` is
|
||||
still read from in 1.7. Sessions will be migrated to the new ``_language``
|
||||
key as they are written.
|
||||
selected language with the session key ``_language``. This should only be
|
||||
accessed using the :data:`~django.utils.translation.LANGUAGE_SESSION_KEY`
|
||||
constant. Previously it was stored with the key ``django_language`` and the
|
||||
``LANGUAGE_SESSION_KEY`` constant did not exist, but keys reserved for Django
|
||||
should start with an underscore. For backwards compatibility ``django_language``
|
||||
is still read from in 1.7. Sessions will be migrated to the new key
|
||||
as they are written.
|
||||
|
||||
* The :ttag:`blocktrans` now supports a ``trimmed`` option. This
|
||||
option will remove newline characters from the beginning and the end of the
|
||||
|
||||
Reference in New Issue
Block a user