[Django] #36636: Outdated documentation in set_language() references removed session-based language storage

8 views
Skip to first unread message

Django

unread,
Oct 2, 2025, 12:30:51 PM (4 days ago) Oct 2
to django-...@googlegroups.com
#36636: Outdated documentation in set_language() references removed session-based
language storage
-------------------------------------+-------------------------------------
Reporter: Samriddha Kumar | Type: Bug
Tripathi | Component:
Status: new | Documentation
Version: 5.2 | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
The documentation and docstring for `django.views.i18n.set_language()`
contain outdated information about session-based language storage, which
was deprecated in Django 3.0 and removed in Django 4.0.

**Affected locations:**

1. **Docstring in `django/views/i18n.py`:**
Current text says: "Redirect to a given URL while setting the chosen
language **in the session** (if enabled) and in a cookie."

2. **Documentation (i18n section):**
Current text says: "The view expects to be called via the POST method,
with a language parameter set in request. **If session support is enabled,
the view saves the language choice in the user's session.** It also saves
the language choice in a cookie that is named django_language by default."

**The issue:**

The actual code in `set_language()` does NOT save the language to the
session. According to the Django 3.0 release notes:

> "To limit creation of sessions and hence favor some caching strategies,
django.views.i18n.set_language() will stop setting the user's language in
the session in Django 4.0. Since Django 2.1, the language is always stored
in the LANGUAGE_COOKIE_NAME cookie."

**Expected behavior:**

Both the docstring and documentation should be updated to remove
references to session storage and clarify that the language choice is
stored only in the cookie (LANGUAGE_COOKIE_NAME, which defaults to
django_language).

**Credit:** Issue reported by kid_alan_ on Discord.
--
Ticket URL: <https://code.djangoproject.com/ticket/36636>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 3, 2025, 7:08:43 AM (3 days ago) Oct 3
to django-...@googlegroups.com
#36636: Outdated documentation in set_language() references removed session-based
language storage
-------------------------------------+-------------------------------------
Reporter: Samriddha Kumar | Owner: Dani
Tripathi | Fornons
Type: Bug | Status: assigned
Component: Documentation | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Dani Fornons):

* owner: (none) => Dani Fornons
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/36636#comment:1>

Django

unread,
Oct 3, 2025, 8:27:42 AM (3 days ago) Oct 3
to django-...@googlegroups.com
#36636: Outdated documentation in set_language() references removed session-based
language storage
-------------------------------------+-------------------------------------
Reporter: Samriddha Kumar | Owner: Dani
Tripathi | Fornons
Type: Bug | Status: assigned
Component: Documentation | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Dani Fornons):

I’ve opened a PR with the proposed changes, treating it as a draft until
the ticket is verified.
--
Ticket URL: <https://code.djangoproject.com/ticket/36636#comment:2>

Django

unread,
Oct 3, 2025, 10:44:00 AM (3 days ago) Oct 3
to django-...@googlegroups.com
#36636: Outdated documentation in set_language() references removed session-based
language storage
-------------------------------------+-------------------------------------
Reporter: Samriddha Kumar | Owner: Dani
Tripathi | Fornons
Type: Bug | Status: assigned
Component: Documentation | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* stage: Unreviewed => Accepted

Comment:

Thanks, looks like this was missed in
d134b0b93ee10a2128c595997cbc6022c4a982f7.
--
Ticket URL: <https://code.djangoproject.com/ticket/36636#comment:3>

Django

unread,
Oct 3, 2025, 1:06:15 PM (3 days ago) Oct 3
to django-...@googlegroups.com
#36636: Outdated documentation in set_language() references removed session-based
language storage
-------------------------------------+-------------------------------------
Reporter: Samriddha Kumar | Owner: Dani
Tripathi | Fornons
Type: Bug | Status: assigned
Component: Documentation | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/36636#comment:4>

Django

unread,
Oct 3, 2025, 3:16:48 PM (3 days ago) Oct 3
to django-...@googlegroups.com
#36636: Outdated documentation in set_language() references removed session-based
language storage
-------------------------------------+-------------------------------------
Reporter: Samriddha Kumar | Owner: Dani
Tripathi | Fornons
Type: Bug | Status: closed
Component: Documentation | Version: 5.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls <jacobtylerwalls@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"2514857e3fae831106832cca8823237801cf2cad" 2514857e]:
{{{#!CommitTicketReference repository=""
revision="2514857e3fae831106832cca8823237801cf2cad"
Fixed #36636, Refs #15902 -- Removed session-based storage reference from
set_language() docs.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36636#comment:5>

Django

unread,
Oct 3, 2025, 3:18:07 PM (3 days ago) Oct 3
to django-...@googlegroups.com
#36636: Outdated documentation in set_language() references removed session-based
language storage
-------------------------------------+-------------------------------------
Reporter: Samriddha Kumar | Owner: Dani
Tripathi | Fornons
Type: Bug | Status: closed
Component: Documentation | Version: 5.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls <jacobtylerwalls@…>):

In [changeset:"ec81e68000dcd78426f7ecaa8e8d0ddce87cb471" ec81e680]:
{{{#!CommitTicketReference repository=""
revision="ec81e68000dcd78426f7ecaa8e8d0ddce87cb471"
[6.0.x] Fixed #36636, Refs #15902 -- Removed session-based storage
reference from set_language() docs.

Backport of 2514857e3fae831106832cca8823237801cf2cad from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36636#comment:6>

Django

unread,
Oct 3, 2025, 3:18:22 PM (3 days ago) Oct 3
to django-...@googlegroups.com
#36636: Outdated documentation in set_language() references removed session-based
language storage
-------------------------------------+-------------------------------------
Reporter: Samriddha Kumar | Owner: Dani
Tripathi | Fornons
Type: Bug | Status: closed
Component: Documentation | Version: 5.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls <jacobtylerwalls@…>):

In [changeset:"2d2e1a6a9dbfe0cba58a4d2486c51fccdb501d55" 2d2e1a6a]:
{{{#!CommitTicketReference repository=""
revision="2d2e1a6a9dbfe0cba58a4d2486c51fccdb501d55"
[5.2.x] Fixed #36636, Refs #15902 -- Removed session-based storage
reference from set_language() docs.

Backport of 2514857e3fae831106832cca8823237801cf2cad from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36636#comment:7>
Reply all
Reply to author
Forward
0 new messages