Safari specifies only one language to the server in ACCEPT_LANGUAGE header

Why does Safari ignore all of the user's system preferences for languages except the first language? Safari sends only the most-preferred language's code (such as "en" or "ru") to the server. The HTTP standard allows much more detail than this. Multiple languages are permitted, and the browser can specify for each language a weight, to show its relative preference. Other browsers give more detail. Safari could give more detail, because OS X permits the user to specify many languages and order them by preference in System Preferences.

I'm developing a Web application that uses all the browser's language preferences in order to give the user a choice among interface languages and show all the preferred languages at the top. This works with, for example, Firefox, but with Safari only the single most-preferred language can be shown at the top.

G4 tower, Mac OS X (10.4.10), iPhone 8GB

Posted on Jan 14, 2008 8:17 PM

Reply
7 replies

Jan 16, 2008 4:01 PM in response to Hawaiian_Starman

I agree with what the OP is saying here. With "other" browsers, the accept-language header differs from what Safari sends in two ways:

1. If the user has specified multiple languages in preference order (for example I have en-AU (Australian English), then en-UK (UK English) then en-US (US English) in that order), all three are sent to the website (in order) in the accept-language header on each request, so the website can match on the best (most preferred) language they support that I'd like to see. Safari only sends one (equating to the first language I have chosen in System Preferences)

2. (this is actually the worse one for me) Other browsers send the full language request tag for the specific language/locale that has been chosen, Safari only sends the basic language one. That is, even though I have chosen Australian English (en-au) and you might have chosen US English (en-US or just en), Safari will only send en in the accept-language header. The effect of this (other than some spelling differences in the website if they explicitly support both) is that dates are formatted for me the "wrong" way. In Australia (and the UK) we specify dates as day/month/year; in the US it is month/day/year (ie 1/9 is 1-September for me but is 9-January for US people).

See 14.4 in this page for what Safari isn't doing, it does a lot better job of explaining this than I have stumbled through above: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html


ted.h.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Safari specifies only one language to the server in ACCEPT_LANGUAGE header

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.