Forum Moderators: phranque
Parts of the site that are currently under development will eventually include 12 different languages, although for the moment there is only English.
So I am asking them to set the Content-Language header - which is currently not configured, but Accept-Langauge is. Because my communications channel to the sys admin is barely stitched together, I want to discover if I should address the Accept-Language issue in the same communication. I may only get one chance!
[httpd.apache.org...]
ftp://ftp.rfc-editor.org/in-notes/rfc2616.txt
There are two parts to language negotiation. Accept-Language is used to indicate which languages are prefered. Content-Language is used to indicate the intended audience of the entity is. (Note that these headers can be used on both the client and server side.)
You will send the browser a Content-Language header matching the language of the document. The browsers send you an Accept-Language header indicating which languages they prefer. If they don't send an Accept-Language header, you'll have to provide some kind of default page.
You should match up the browser's Accept-Language header to what documents you have available, and should set the appropriate Content-Language header for documents you send. If you've got a Danish/English site, and the user requests Danish (Accept-Language: da, en;q=0.8), you give them Danish (Content-Language: da. If they request Swahili, you pick a reasonable alternative. If you have a document intended for a multi-lingual audience (the French constitution?) you set both languages (Content-Language: en-CA, fr-CA).
The browser may send you a Content-Language header if they POST you data. You may send the browser an Accept-Language header indicating what languages you would like information to be POSTed in. (I doubt you'll find a browser that does anything with an incoming Accept-Language or sends an outgoing Content-Language header, though.)