What is the Accept-Language header?
Short answer
Accept-Language is the request header with which the browser informs the server of the user's language preferences; the languages are ordered by being weighted with q values (tr-TR,tr;q=0.9,en;q=0.8). The value comes from the browser or operating system settings. In TR7, the Client Language Preference condition evaluates this header according to the q values: it asks whether the client accepts the language in the Language field, or whether it wants it more than the languages in the Languages to Compare field; regional variants are included in the base language (selecting English (en) also covers en-US and en-GB). The condition works only on the HTTP vService and at the request stage. Bot Protection also scores the header not being sent at all as a bot signal.
Where It Is Used in TR7
| Where | Field / label | What for |
|---|---|---|
| Load Balancer → Conditions (Policy Match) → condition form | Criteria → Client language preference | A decision based on the language preference (only HTTP vService, request stage) |
| Same form | Language, Languages to Compare | The language to be inspected and the languages to be compared |
| Condition selection lists | If the client prefers Turkish over English, If the client prefers English over Turkish | Ready-made conditions for the Turkish–English distinction |
| Bot/DDoS → Bot/DDoS Protected vService List → Bot/DDoS Management → Bot Protection → Factors | Protocol Hygiene → Missing Headers | Reflecting in the bot score a client that leaves out either Accept-Language or Accept-Encoding |
Setting up language-based routing: Can I route based on the browser's language preference?
Common Misconceptions
- "Accept-Language shows the country where the user is located." The header is a language preference; for a location-based decision, the Source IP condition, which looks at the country of the source IP, is used.
- "A language appearing in the header means that the language is preferred." In the
en-US,tr;q=0.1header, "tr" appears, but the actual preference is English. The condition does not do text matching; it decides according to the q values; a language marked withq=0is treated as not accepted. - "The header is present in every request." Some clients and scripts do not send the header; in these requests, the condition is not met and the request is processed through the path that is not tied to the condition (e.g. Default Backend Services).
How it is done in the documentation
