#7831 closed (fixed)
get_language_from_request should be case-insensitive while matching settings.LANGUAGES
| Reported by: | bear330 | Owned by: | nobody | 
|---|---|---|---|
| Component: | Internationalization | Version: | dev | 
| Severity: | Keywords: | locale, language, case, middleware | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no | 
| Needs tests: | no | Patch needs improvement: | no | 
| Easy pickings: | no | UI/UX: | no | 
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 (1)
Change History (5)
by , 17 years ago
| Attachment: | 7831.patch added | 
|---|
comment:1 by , 17 years ago
| milestone: | → 1.0 | 
|---|---|
| Triage Stage: | Unreviewed → Accepted | 
comment:2 by , 17 years ago
| Has patch: | set | 
|---|
comment:3 by , 17 years ago
| Resolution: | → fixed | 
|---|---|
| Status: | new → closed | 
  Note:
 See   TracTickets
 for help on using tickets.
    
Simple patch to fix that.