Skip to main content
WCAGrules
Quick navigation

Send the content language in the HTTP header

SVR5 is an advisory technique, and the distinction changes what you should do with it. Advisory means it helps and is not enough on its own, so sending this header does not settle the language rule and never did. The header names the primary language of the page's intended audience at the protocol level, which is about who the content is for rather than what language the text is in. That is precisely why it is advisory. What actually decides how a page sounds is the lang attribute on the html element, because that is where a screen reader looks before choosing a voice. W3C's own wording assumes the attribute is already correct and describes the header as listing what the attribute specifies. So send SVR5 as a supplement to a correct lang attribute, never as a substitute for one. The sufficient technique for the language rule is the attribute itself, and it is the finding that matters in an audit.

How we find it in an audit

We read the response header and the html element together, because either on its own tells you almost nothing. A header with no attribute is the failure case worth naming, since the page will still be read in the wrong voice by every screen reader that meets it. An attribute with no header is fine. The published test is a match check, confirming the header value agrees with the page's declared language. That is another way of saying the header comes from the attribute rather than the other way round. Both halves are automatable and we automate them.

How affected users experience it

A screen reader picks its voice and its pronunciation rules from the language the page declares. Get it wrong and French text is read with English pronunciation rules, which does not produce accented French. It produces sounds that are not words in either language. A page like that is not hard to follow. It is impossible. The reader has no way to know that a one-word attribute is the reason. Setting it correctly takes a minute and changes whether the page can be listened to at all.

Passes vs. fails

Passes: the right voice reads the page. Fails: no lang, so the wrong voice reads it.

Passes

Content-Language: fr
<html lang="fr">
<!-- The attribute chooses the voice. The header documents the audience. -->

Fails

HTTP/1.1 200 OK
Content-Type: text/html
<html>
<!-- No header, no lang attribute. Every screen reader guesses, and guesses English. -->

How this gets tested

The W3C publishes test rules that define what a checker looks for here.

The other techniques filed under this rule

4 guides on this site are filed under 3.1.1 Language of Page. W3C lists this one as advisory for that rule rather than sufficient, which means it helps real readers without being accepted as evidence you conformed.

This guide is our interpretation of W3C technique SVR5: Specifying the default language in the HTTP header. W3C publishes its techniques as guidance rather than as the standard, and says so on every one of them. The success criterion is what conformance is measured against, and a technique is one documented way to meet it.

Go somewhere useful

Find tools, resources and your workspace.

29 destinations