﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
23689	Django detects HTTP Accept-Language header in case-sensitive manner	wayneye	Zainab Amir	"This issue was originally discussed in django-developers: https://groups.google.com/forum/#!topic/django-developers/1Y9LZSAOSnE

Per [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4 w3c], [http://tools.ietf.org/html/rfc2616#page-104 rfc2616] and [http://tools.ietf.org/html/bcp47 bcp47], Language tags should be parsed in case-insensitive, however, I noticed that Django detects HTTP Accept-Language headers in case-sensitive manner.

For example, the following headers:

{{{
Chrome:   Accept-Language:  zh-TW,zh;q=0.8,en-US;q=0.6,en;q=0.4
Firefox:  Accept-Language:  zh-tw,zh;q=0.8,en-us;q=0.5,en;q=0.3
}}}

Django will correctly display Traditional Chinese for Chrome, but won't for Firefox because of lower-cased TW.

The fix contains two parts:
1. Fix potential case-sensitive places in code to follow case-insensitive (for example parse_accept_lang_header())
2. Fix [https://docs.djangoproject.com/en/dev/topics/i18n/#definitions documentation], correct the sentence ""Browsers send the names of the languages they accept in the Accept-Language HTTP header using this format. Examples: it, de-at, es, pt-br. Both the language and the country parts are in lower case. "", which obviously incorrect, Chrome uses tags like zh-TW, pt-BR."	Bug	closed	Internationalization	4.0	Normal	fixed		Claude Paroz Daniel Finch	Ready for checkin	1	0	0	0	0	0
