Django

Code

Ticket #7831 (closed: fixed)

Opened 5 months ago

Last modified 3 months ago

get_language_from_request should be case-insensitive while matching settings.LANGUAGES

Reported by: bear330 Assigned to: nobody
Milestone: 1.0 Component: Internationalization
Version: SVN Keywords: locale, language, case, middleware
Cc: Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

HTTP_ACCEPT_LANGUAGE sent by browser will be different from its vendor or OS, for example: In XP, IE(6 or 7) will send zh-tw, in Vista it will be zh-TW But firefox2 in some machine will send zh-tw or zh-TW, In firefox3, it will send zh-tw always. (In my machine).

This will cause this line in trans_real.py failed:

            if lang not in supported:
                continue

It should compare it with case-insensitive way to fulfill all situations.

Thanks.

Attachments

7831.patch (0.5 kB) - added by bear330 on 07/19/08 02:58:09.
Simple patch to fix that.

Change History

07/19/08 02:58:09 changed by bear330

  • attachment 7831.patch added.

Simple patch to fix that.

07/19/08 08:49:43 changed by Karen Tracey <kmtracey@gmail.com>

  • needs_better_patch changed.
  • needs_docs changed.
  • stage changed from Unreviewed to Accepted.
  • needs_tests changed.
  • milestone set to 1.0.

08/01/08 15:29:54 changed by ebruning

  • has_patch set to 1.

08/25/08 17:53:45 changed by jacob

  • status changed from new to closed.
  • resolution set to fixed.

(In [8561]) Fixed #7831: be case-insensitive when in get_language_from_request.


Add/Change #7831 (get_language_from_request should be case-insensitive while matching settings.LANGUAGES)




Change Properties
Action