Compare Revisions
Accept-Language
Revision 1106859:
Revision 1106859 by teoli on
Revision 1107071:
Revision 1107071 by fscholz on
- Title:
- Accept-Language
- Accept-Language
- Slug:
- Web/HTTP/Headers/Accept-Language
- Web/HTTP/Headers/Accept-Language
- Tags:
- "Content Negotiation" "HTTP" "HTTP Header" "Reference" "Request header"
- "Content Negotiation" "HTTP" "HTTP Header" "Reference" "Request header"
- Comment:
- review
- Content:
-
Revision 1106859 Revision 1107071 n 11 The <strong><code>Accept-Language</code></strong> request H n 11 The <strong><code>Accept-Language</code></strong> request H > TTP header advertises which languages the client is able to under > TTP header advertises which languages the client is able to under > stand, and which locale variant is preferred. Using <a href="/en- > stand, and which locale variant is preferred. Using <a href="/en- > US/docs/Web/HTTP/Content_negotiation">content negotiation</a>, th > US/docs/Web/HTTP/Content_negotiation">content negotiation</a>, th > e server then selects one of the proposal, use it and inform the > e server then selects one of the proposals, uses it and informs t > client of its choice with the {{HTTPHeader("Content-Language")}} > he client of its choice with the {{HTTPHeader("Content-Language") > response header. Browsers set adequate values for this header acc > }} response header. Browsers set adequate values for this header > ording their user interface language and even if a user can chang > according their user interface language and even if a user can ch > e it, this happens rarely (and is frown upon as it leads to finge > ange it, this happens rarely (and is frown upon as it leads to fi > rprinting). > ngerprinting). n 14 This header is a hint to be used when the server has no way n 14 This header is a hint to be used when the server has no way > of determining the language via another way, like a specific URL > of determining the language via another way, like a specific URL > , that is controlled by an explicit user decision. It is recommen > , that is controlled by an explicit user decision. It is recommen > ded that the server never overrides an explicit decision. The con > ded that the server never overrides an explicit decision. The con > tent of the <code>Accept-Language</code> is often out of the cont > tent of the <code>Accept-Language</code> is often out of the cont > rol of the user (like when he is traveling and using an Internet > rol of the user (like when traveling and using an Internet Cafe i > Cafe); the user may also want to visit a page in another language > n a different country); the user may also want to visit a page in > than the locale of its user interface. > another language than the locale of their user interface. n 17 If the server cannot serve any matching language, it can th n 17 If the server cannot serve any matching language, it can th > eoretically send back a {{HTTPStatus("406")}} <code>Not Acceptabl > eoretically send back a {{HTTPStatus("406")}} (Not Acceptable) er > e</code> error code. But, for UX reasons, this is rarely done and > ror code. But, for a better user experience, this is rarely done > the standard way is to ignore the <code>Accept-Language</code> h > and more common way is to ignore the <code>Accept-Language</code> > eader in this case. > header in this case. n 64 A full language tag. In addition to the language itself, n 64 A full language tag. In addition to the language itself, > it may contains additional information after a <code>'-'</code>. > it may contains additional information after a <code>'-'</code>. > The most common extra information are the country variant (like < > The most common extra information is the country variant (like <c > code>'en-US'</code>) or the type of alphabet to use (like <code>' > ode>'en-US'</code>) or the type of alphabet to use (like <code>'s > sr-Lat'</code>). Other variant like the type of orthography (<cod > r-Lat'</code>). Other variants like the type of orthography (<cod > e>'de-DE-1996'</code>) are normally never used in the context of > e>'de-DE-1996'</code>) are usually not used in the context of thi > this header > s header. t 76 Any value used is placed in an order of preference expres t 76 Any value placed in an order of preference expressed usin > sed using relative <a href="/en-US/docs/Glossary/Q-factor">qualit > g a relative <a href="/en-US/docs/Glossary/Q-factor">quality fact > y factor</a> called the <em>weight</em>. > or</a> called <em>weight</em>.