Code

Ticket #5603: language_cookie_name_docs.diff

File language_cookie_name_docs.diff, 2.1 KB (added by moe, 7 years ago)

docs patch

Line 
1Index: settings.txt
2===================================================================
3--- settings.txt        (revision 6728)
4+++ settings.txt        (working copy)
5@@ -538,6 +538,16 @@
6 
7 .. _internationalization docs: ../i18n/
8 
9+LANGUAGE_COOKIE_NAME
10+--------------------
11+
12+Default: ``'django_language'``
13+
14+The name of the cookie to use for the language cookie. This can be whatever
15+you want but must be different to all other cookie names (e.g. SESSION_COOKIE_NAME).
16+See the `internationalization docs`_ for details.
17+
18+
19 LANGUAGES
20 ---------
21 
22@@ -781,7 +791,8 @@
23 
24 Default: ``'sessionid'``
25 
26-The name of the cookie to use for sessions. This can be whatever you want.
27+The name of the cookie to use for sessions. This can be whatever you want
28+but must be different to all other cookie names (e.g. LANGUAGE_COOKIE_NAME).
29 See the `session docs`_.
30 
31 SESSION_COOKIE_PATH
32Index: i18n.txt
33===================================================================
34--- i18n.txt    (revision 6728)
35+++ i18n.txt    (working copy)
36@@ -539,7 +539,7 @@
37 
38     * First, it looks for a ``django_language`` key in the the current user's
39       `session`_.
40-    * Failing that, it looks for a cookie called ``django_language``.
41+    * Failing that, it looks for a cookie that is named according to your ``LANGUAGE_COOKIE_NAME`` setting (the default name is: ``django_language``).
42     * Failing that, it looks at the ``Accept-Language`` HTTP header. This
43       header is sent by your browser and tells the server which language(s) you
44       prefer, in order by priority. Django tries each language in the header
45@@ -711,7 +711,8 @@
46 The view expects to be called via the ``POST`` method, with a ``language``
47 parameter set in request. If session support is enabled, the view
48 saves the language choice in the user's session. Otherwise, it saves the
49-language choice in a ``django_language`` cookie.
50+language choice in a cookie that is by default named ``django_language``
51+(the name can be changed through the ``LANGUAGE_COOKIE_NAME`` setting).
52 
53 After setting the language choice, Django redirects the user, following this
54 algorithm: