Django 1.6 RC1 language key in session

107 views
Skip to first unread message

Miguel Araujo Pérez

unread,
Nov 5, 2013, 11:10:01 AM11/5/13
to django-d...@googlegroups.com
Hi there,

Django 1.6 changes the key name that is used to store the language preferred by the user, due to the new name policies. This commit introduced it:

If you look at `django.views.i18n.set_language` you will see that `'_language'` is now used, when in django 1.5 used to be `'django_language'`. 

In my humble opinion this key should be a variable that could be imported from the outside. We currently have the following use case:

We let an anonymous user set a language for the page, and when the user logs in, we keep the language around in session to continue rendering the web in the same language. This change in the key name breaks our book keeping, because we are using a hardcoded string (we only keep that key, not all of them).

Thanks, cheers
Miguel Araujo


Tim Graham

unread,
Nov 5, 2013, 11:21:36 AM11/5/13
to django-d...@googlegroups.com
Sounds like a good idea Miguel, please open a ticket or send a pull request that references the original ticket.

Just wanted to clarify that the commit you referenced will be part of Django 1.7, not 1.6.
Reply all
Reply to author
Forward
0 new messages