Django

Code

Ticket #5603: language_cookie_name_docs.diff

File language_cookie_name_docs.diff, 2.1 kB (added by moe, 1 year ago)

docs patch

  • settings.txt

    old new  
    538538 
    539539.. _internationalization docs: ../i18n/ 
    540540 
     541LANGUAGE_COOKIE_NAME 
     542-------------------- 
     543 
     544Default: ``'django_language'`` 
     545 
     546The name of the cookie to use for the language cookie. This can be whatever 
     547you want but must be different to all other cookie names (e.g. SESSION_COOKIE_NAME). 
     548See the `internationalization docs`_ for details. 
     549 
     550 
    541551LANGUAGES 
    542552--------- 
    543553 
     
    781791 
    782792Default: ``'sessionid'`` 
    783793 
    784 The name of the cookie to use for sessions. This can be whatever you want. 
     794The name of the cookie to use for sessions. This can be whatever you want 
     795but must be different to all other cookie names (e.g. LANGUAGE_COOKIE_NAME). 
    785796See the `session docs`_. 
    786797 
    787798SESSION_COOKIE_PATH 
  • i18n.txt

    old new  
    539539 
    540540    * First, it looks for a ``django_language`` key in the the current user's 
    541541      `session`_. 
    542     * Failing that, it looks for a cookie called ``django_language``
     542    * Failing that, it looks for a cookie that is named according to your ``LANGUAGE_COOKIE_NAME`` setting (the default name is: ``django_language``)
    543543    * Failing that, it looks at the ``Accept-Language`` HTTP header. This 
    544544      header is sent by your browser and tells the server which language(s) you 
    545545      prefer, in order by priority. Django tries each language in the header 
     
    711711The view expects to be called via the ``POST`` method, with a ``language`` 
    712712parameter set in request. If session support is enabled, the view 
    713713saves the language choice in the user's session. Otherwise, it saves the 
    714 language choice in a ``django_language`` cookie. 
     714language choice in a cookie that is by default named ``django_language`` 
     715(the name can be changed through the ``LANGUAGE_COOKIE_NAME`` setting). 
    715716 
    716717After setting the language choice, Django redirects the user, following this 
    717718algorithm: