mirror of https://github.com/django/django.git
Fixed #5489 -- Updated docs to reflect the changes in [6177]. Thanks, msaelices.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6272 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
8a17181b58
commit
32ed883861
|
@ -641,15 +641,15 @@ Activate this view by adding the following line to your URLconf::
|
||||||
|
|
||||||
(Note that this example makes the view available at ``/i18n/setlang/``.)
|
(Note that this example makes the view available at ``/i18n/setlang/``.)
|
||||||
|
|
||||||
The view expects to be called via the ``GET`` method, with a ``language``
|
The view expects to be called via the ``POST`` method, with a ``language``
|
||||||
parameter set in the query string. If session support is enabled, the view
|
parameter set in request. If session support is enabled, the view
|
||||||
saves the language choice in the user's session. Otherwise, it saves the
|
saves the language choice in the user's session. Otherwise, it saves the
|
||||||
language choice in a ``django_language`` cookie.
|
language choice in a ``django_language`` cookie.
|
||||||
|
|
||||||
After setting the language choice, Django redirects the user, following this
|
After setting the language choice, Django redirects the user, following this
|
||||||
algorithm:
|
algorithm:
|
||||||
|
|
||||||
* Django looks for a ``next`` parameter in the query string.
|
* Django looks for a ``next`` parameter in ``POST`` request.
|
||||||
* If that doesn't exist, or is empty, Django tries the URL in the
|
* If that doesn't exist, or is empty, Django tries the URL in the
|
||||||
``Referer`` header.
|
``Referer`` header.
|
||||||
* If that's empty -- say, if a user's browser suppresses that header --
|
* If that's empty -- say, if a user's browser suppresses that header --
|
||||||
|
@ -657,7 +657,7 @@ algorithm:
|
||||||
|
|
||||||
Here's example HTML template code::
|
Here's example HTML template code::
|
||||||
|
|
||||||
<form action="/i18n/setlang/" method="get">
|
<form action="/i18n/setlang/" method="post">
|
||||||
<input name="next" type="hidden" value="/next/page/" />
|
<input name="next" type="hidden" value="/next/page/" />
|
||||||
<select name="language">
|
<select name="language">
|
||||||
{% for lang in LANGUAGES %}
|
{% for lang in LANGUAGES %}
|
||||||
|
|
Loading…
Reference in New Issue