[Django Code] #5789: Django LocaleMiddleware django_language should be _language

2 views
Skip to first unread message

Django Code

unread,
Oct 20, 2007, 7:01:25 PM10/20/07
to djang...@holovaty.com, ja...@jacobian.org, django-...@googlegroups.com
#5789: Django LocaleMiddleware django_language should be _language
---------------------------------+------------------------------------------
Reporter: jdunck | Owner: nobody
Status: new | Component: Uncategorized
Version: SVN | Keywords: session i18n backwards-incompatible
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------+------------------------------------------
According to the Django book, all Django-reserved session keys begin with
"_", but the framework currently uses "django_language" rather than
"_language".

--
Ticket URL: <http://code.djangoproject.com/ticket/5789>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines

Django Code

unread,
Mar 2, 2008, 11:04:45 AM3/2/08
to djang...@holovaty.com, django-...@googlegroups.com
#5789: Django LocaleMiddleware django_language should be _language
---------------------------------------------------+------------------------
Reporter: jdunck | Owner: nobody
Status: new | Component: Uncategorized
Version: SVN | Resolution:
Keywords: session i18n backwards-incompatible | Stage: Accepted
Has_patch: 0 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
---------------------------------------------------+------------------------
Changes (by jacob):

* stage: Unreviewed => Accepted

--
Ticket URL: <http://code.djangoproject.com/ticket/5789#comment:1>

Django Code

unread,
Mar 2, 2008, 9:03:35 PM3/2/08
to djang...@holovaty.com, django-...@googlegroups.com
#5789: Django LocaleMiddleware django_language should be _language
---------------------------------------------------+------------------------
Reporter: jdunck | Owner: nobody
Status: new | Component: Internationalization
Version: SVN | Resolution:
Keywords: session i18n backwards-incompatible | Stage: Accepted
Has_patch: 0 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
---------------------------------------------------+------------------------
Changes (by mtredinnick):

* component: Uncategorized => Internationalization

--
Ticket URL: <http://code.djangoproject.com/ticket/5789#comment:2>

Django Code

unread,
Mar 17, 2008, 4:03:09 PM3/17/08
to djang...@holovaty.com, django-...@googlegroups.com
#5789: Django LocaleMiddleware django_language should be _language
---------------------------------------------------+------------------------
Reporter: jdunck | Owner: stugots
Status: assigned | Component: Internationalization
Version: SVN | Resolution:
Keywords: session i18n backwards-incompatible | Stage: Accepted
Has_patch: 0 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
---------------------------------------------------+------------------------
Changes (by stugots):

* owner: nobody => stugots
* status: new => assigned

--
Ticket URL: <http://code.djangoproject.com/ticket/5789#comment:3>

Django Code

unread,
Mar 17, 2008, 4:41:42 PM3/17/08
to djang...@holovaty.com, django-...@googlegroups.com
#5789: Django LocaleMiddleware django_language should be _language
---------------------------------------------------+------------------------
Reporter: jdunck | Owner: stugots
Status: assigned | Component: Internationalization
Version: SVN | Resolution:
Keywords: session i18n backwards-incompatible | Stage: Accepted
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
---------------------------------------------------+------------------------
Changes (by stugots):

* has_patch: 0 => 1

Comment:

Patch file attached.

Note, svn thinks all of i18n.txt changed due to bug #6545, which refers to
a line-ending problem with pool text files.

--
Ticket URL: <http://code.djangoproject.com/ticket/5789#comment:4>

Django Code

unread,
Mar 19, 2008, 12:04:41 AM3/19/08
to djang...@holovaty.com, django-...@googlegroups.com
#5789: Django LocaleMiddleware django_language should be _language
---------------------------------------------------+------------------------
Reporter: jdunck | Owner: stugots
Status: assigned | Component: Internationalization
Version: SVN | Resolution:
Keywords: session i18n backwards-incompatible | Stage: Accepted
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
---------------------------------------------------+------------------------
Comment (by mtredinnick):

The goal here is only to change the name of the variable stored inside the
session dictionary to be consistent with other Django internal session
keys. It is '''not''' about changing the cookie name. So the first part of
the patch can be removed.

This does introduce an interesting backwards incompatibility. If a site
upgrades to this version of the code, their users will lose the session
language setting (since Django will start looking for a different key
name) and if the session language is different from their browser
preference, it will revert to the browser preference. It's a little
annoying, because we try to avoid breaking things for users.

For bonus points, does anybody want to come up with a little Python script
we can put on the backwards incompatible page in the wiki that will
upgrade all sessions in the database to use the new format: it should
unpack the session, moves the `django_language` key to `_language` and
then resaves the session,preferably without modifying the expiry time. I
guess this isn't a showstopper, since the number of people affected will
be small (usually the browser and the language preference match, but
conflicts like Catalan/Spanish do exist).

--
Ticket URL: <http://code.djangoproject.com/ticket/5789#comment:5>

Django Code

unread,
Mar 19, 2008, 12:04:53 AM3/19/08
to djang...@holovaty.com, django-...@googlegroups.com
#5789: Django LocaleMiddleware django_language should be _language
---------------------------------------------------+------------------------
Reporter: jdunck | Owner: stugots
Status: assigned | Component: Internationalization
Version: SVN | Resolution:
Keywords: session i18n backwards-incompatible | Stage: Accepted
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 1
---------------------------------------------------+------------------------
Changes (by mtredinnick):

* needs_better_patch: 0 => 1

--
Ticket URL: <http://code.djangoproject.com/ticket/5789#comment:6>
Reply all
Reply to author
Forward
0 new messages