Re: [Django] #14825: LocaleMiddleware should store language preferences if possible

9 views
Skip to first unread message

Django

unread,
May 24, 2011, 3:21:36 PM5/24/11
to django-...@googlegroups.com
#14825: LocaleMiddleware should store language preferences if possible
-------------------------------------+-------------------------------------
Reporter: vzima | Owner: nobody
Type: New | Status: new
feature | Component:
Milestone: | Internationalization
Version: 1.2 | Severity: Normal
Resolution: | Keywords:
Triage Stage: Design | Has patch: 1
decision needed | Needs tests: 1
Needs documentation: 1 | Easy pickings: 0
Patch needs improvement: 1 |
-------------------------------------+-------------------------------------
Changes (by raymond.penners@…):

* cc: raymond.penners@… (added)
* easy: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/14825#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 3, 2013, 8:53:39 PM3/3/13
to django-...@googlegroups.com
#14825: LocaleMiddleware should store language preferences if possible
-------------------------------------+-------------------------------------
Reporter: vzima | Owner: nobody
Type: New feature | Status: new
Component: | Version: 1.2
Internationalization | Resolution:
Severity: Normal | Triage Stage: Design
Keywords: | decision needed
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by ramiro):

See also #15902 and http://groups.google.com/d/topic/django-
developers/8THmJSioj4U/discussion.

--
Ticket URL: <https://code.djangoproject.com/ticket/14825#comment:8>

Django

unread,
Mar 23, 2013, 5:22:00 PM3/23/13
to django-...@googlegroups.com
#14825: LocaleMiddleware should store language preferences if possible
--------------------------------------+------------------------------------

Reporter: vzima | Owner: nobody
Type: New feature | Status: new
Component: Internationalization | Version: 1.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by aaugustin):

* stage: Design decision needed => Accepted


Comment:

This is a reasonable short-term workaround. #15902 will certainly take
more time.

The patch is a good starting point, but it needs tests. Also, please use
`in` rather than `has_key`, and consider using `setdefault` where
possible.

I view this as a bugfix more than a new feature, but a line in the release
notes can't hurt.

--
Ticket URL: <https://code.djangoproject.com/ticket/14825#comment:9>

Django

unread,
Mar 25, 2013, 12:16:27 PM3/25/13
to django-...@googlegroups.com
#14825: LocaleMiddleware should store language preferences if possible
--------------------------------------+------------------------------------
Reporter: vzima | Owner: vzima
Type: New feature | Status: assigned

Component: Internationalization | Version: 1.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by vzima):

* status: new => assigned
* needs_better_patch: 1 => 0
* owner: nobody => vzima
* needs_tests: 1 => 0
* needs_docs: 1 => 0


Comment:

I updated the patch and created a pull request
https://github.com/django/django/pull/957

I also realised that this only affects sessions. `LocaleMiddleware` should
not touch the language cookie in this case, because it is not changed by
session flush.

--
Ticket URL: <https://code.djangoproject.com/ticket/14825#comment:10>

Django

unread,
Mar 25, 2013, 12:17:51 PM3/25/13
to django-...@googlegroups.com
#14825: LocaleMiddleware should store language preferences if possible
-------------------------------------+-------------------------------------

Reporter: vzima | Owner: vzima
Type: New feature | Status: assigned
Component: | Version: 1.2
Internationalization | Resolution:
Severity: Normal | Triage Stage: Ready for
Keywords: | checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by vzima):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/14825#comment:11>

Django

unread,
Mar 25, 2013, 2:16:15 PM3/25/13
to django-...@googlegroups.com
#14825: LocaleMiddleware should store language preferences if possible
--------------------------------------+------------------------------------

Reporter: vzima | Owner: vzima
Type: New feature | Status: assigned
Component: Internationalization | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by charettes):

* version: 1.2 => master
* stage: Ready for checkin => Accepted


Comment:

Please don't mark your own patch as RFC, someone else should review your
work.

--
Ticket URL: <https://code.djangoproject.com/ticket/14825#comment:12>

Django

unread,
May 19, 2013, 7:20:20 AM5/19/13
to django-...@googlegroups.com
#14825: LocaleMiddleware should store language preferences if possible
--------------------------------------+------------------------------------
Reporter: vzima | Owner: vzima
Type: New feature | Status: assigned
Component: Internationalization | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by aaugustin):

This looks good to me. Unfortunately the patch no longer applies after the
sprints we just had. Could you bring it up to date and mark it as RFC once
that's done? (Since I reviewed an almost final version, as an exception,
you can mark it as RFC by yourself.)

--
Ticket URL: <https://code.djangoproject.com/ticket/14825#comment:13>

Django

unread,
May 25, 2013, 4:53:35 AM5/25/13
to django-...@googlegroups.com
#14825: LocaleMiddleware should store language preferences if possible
--------------------------------------+------------------------------------
Reporter: vzima | Owner: vzima
Type: New feature | Status: closed
Component: Internationalization | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Claude Paroz <claude@…>):

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


Comment:

In [changeset:"6de81d65f443a01961c23139ca5d7653ef012d35"]:
{{{
#!CommitTicketReference repository=""
revision="6de81d65f443a01961c23139ca5d7653ef012d35"
Fixed #14825 -- LocaleMiddleware keeps language

* LocaleMiddleware stores language into session if it is not present
there.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/14825#comment:14>

Django

unread,
Nov 20, 2013, 5:23:53 PM11/20/13
to django-...@googlegroups.com
#14825: LocaleMiddleware should store language preferences if possible
--------------------------------------+------------------------------------
Reporter: vzima | Owner: vzima
Type: New feature | Status: closed
Component: Internationalization | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by dave@…):

This change has made multi-language testing much more difficult for
authenticated Django applications.

Prior to this commit, my QA team could follow this simple process to
switch languages during testing:

1. Switch language in browser settings
2. Refresh page
3. Test

Now, they must do this:

1. Switch language in browser settings.
2. Clear session cookie
3. Re-authenticate
4. Navigate to page under test
5. Test

This behavior seems ok for the average user (whose language doesn't change
minute to minute), but for a tester, this really makes things slow. Even
test automation suffers (e.g., Selenium).

Could we at least put this behavior being a setting? Something like
setting.STORE_LANGUAGE_IN_SESSION = True|False (default True)

--
Ticket URL: <https://code.djangoproject.com/ticket/14825#comment:15>

Django

unread,
Nov 21, 2013, 4:29:42 AM11/21/13
to django-...@googlegroups.com
#14825: LocaleMiddleware should store language preferences if possible
--------------------------------------+------------------------------------
Reporter: vzima | Owner: vzima
Type: New feature | Status: closed
Component: Internationalization | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by akaariai):

There is a ticket about this regression, see #21473. The suggested
solution is to not flush language from session on logout.

--
Ticket URL: <https://code.djangoproject.com/ticket/14825#comment:16>

Reply all
Reply to author
Forward
0 new messages