Closed Bug 526301 Opened 16 years ago Closed 16 years ago

[FyFx] Language detection only takes the first component of Accept Language header

Categories

(Webtools Graveyard :: Five Years of Firefox, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: stas, Unassigned)

References

Details

(Keywords: l12y)

Attachments

(1 file)

The language detection in http://viewvc.svn.mozilla.org/vc/projects/fyfx/trunk/index.php?revision=54729&view=markup only takes into account the first component of Accept Language header. $lang = explode("-", $iso_lang[0]); We should support falling back to other locales than en-US. We could use an existing solution, e.g. from mozilla.com: http://viewvc.svn.mozilla.org/vc/projects/mozilla.com/trunk/includes/prefetch.php?revision=54633&view=markup#l79 http://viewvc.svn.mozilla.org/vc/projects/mozilla.com/trunk/includes/langconfig.inc.php?view=markup
This patch uses the Mozilla.com code to correctly detect the locale. It also fixes bug 526305 by registering the locale for gettext using the correct system name (e.g. "fa" gets registered as "fa_IR.utf8"). I'm going to land this asap to allow localizers to preview and test their work.
Landed in r55073. Some further tweaks to the list of supported locales <http://viewvc.svn.mozilla.org/vc/projects/fyfx/trunk/components/locales.inc.php?view=markup&pathrev=55073> might be needed.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: