Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove the link in code blocks that will not work #33297

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 15 additions & 15 deletions files/en-us/web/http/headers/accept-language/index.md
Expand Up @@ -8,11 +8,16 @@ browser-compat: http.headers.Accept-Language
{{HTTPSidebar}}

The **`Accept-Language`** request HTTP header indicates the natural language and locale that the client prefers.
The server uses [content negotiation](/en-US/docs/Web/HTTP/Content_negotiation) to select one of the proposals and informs the client of the choice with the {{HTTPHeader("Content-Language")}} response header. Browsers set required values for this header according to their active user interface language. Users rarely change it, and such changes are not recommended because they may lead to [fingerprinting](/en-US/docs/Glossary/Fingerprinting).
The server uses [content negotiation](/en-US/docs/Web/HTTP/Content_negotiation) to select one of the proposals and informs the client of the choice with the {{HTTPHeader("Content-Language")}} response header.
Browsers set required values for this header according to their active user interface language.
Users rarely change it, and such changes are not recommended because they may lead to [fingerprinting](/en-US/docs/Glossary/Fingerprinting).

This header serves as a hint when the server cannot determine the target content language otherwise (for example, use a specific URL that depends on an explicit user decision). The server should never override an explicit user language choice. The content of `Accept-Language` is often out of a user's control (when traveling, for instance). A user may also want to visit a page in a language different from the user interface language.
This header serves as a hint when the server cannot determine the target content language otherwise (for example, use a specific URL that depends on an explicit user decision).
The server should never override an explicit user language choice. The content of `Accept-Language` is often out of a user's control (when traveling, for instance).
A user may also want to visit a page in a language different from the user interface language.

The server possibly can send back a {{HTTPStatus("406")}} (Not Acceptable) error code when unable to serve content in a matching language. However, such a behavior is rarely implemented for a better user experience, and servers often ignore the `Accept-Language` header in such cases.
The server possibly can send back a {{HTTPStatus("406")}} (Not Acceptable) error code when unable to serve content in a matching language.
However, such a behavior is rarely implemented for a better user experience, and servers often ignore the `Accept-Language` header in such cases.

<table class="properties">
<tbody>
Expand Down Expand Up @@ -43,25 +48,21 @@ The server possibly can send back a {{HTTPStatus("406")}} (Not Acceptable) error
Accept-Language: <language>
Accept-Language: *

// Multiple types, weighted with the {{glossary("quality values", "quality value")}} syntax:
// Multiple types, weighted with the quality value syntax:
Accept-Language: fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7, *;q=0.5
```

## Directives

- `<language>`
- : A language tag (which is sometimes referred to as a "locale identifier"). This
consists of a 2-3 letter base language tag that indicates a language, optionally
followed by additional subtags separated by `'-'`. The most common extra
information is the country or region variant (like `'en-US'` or
`'fr-CA'`) or the type of alphabet to use (like `'sr-Latn'`).
Other variants, like the type of orthography (`'de-DE-1996'`), are usually
not used in the context of this header.
- : A language tag (which is sometimes referred to as a "locale identifier").
This consists of a 2-3 letter base language tag that indicates a language, optionally followed by additional subtags separated by `'-'`.
The most common extra information is the country or region variant (like `'en-US'` or `'fr-CA'`) or the type of alphabet to use (like `'sr-Latn'`).
Other variants, like the type of orthography (`'de-DE-1996'`), are usually not used in the context of this header.
- `*`
- : Any language; `'*'` is used as a wildcard.
- `;q=` (q-factor weighting)
- : Any value placed in an order of preference expressed using a relative
{{glossary("Quality values", "quality value")}} called _weight_.
- : Any value placed in an order of preference expressed using a relative {{glossary("Quality values", "quality value")}} called _weight_.

## Examples

Expand All @@ -88,6 +89,5 @@ Accept-Language: en-US,en;q=0.5
## See also

- HTTP [content negotiation](/en-US/docs/Web/HTTP/Content_negotiation)
- A header with the result of the content negotiation:
{{HTTPHeader("Content-Language")}}
- A header with the result of the content negotiation: {{HTTPHeader("Content-Language")}}
- Other similar headers: {{HTTPHeader("TE")}}, {{HTTPHeader("Accept-Encoding")}}, {{HTTPHeader("Accept")}}