Definition: The language attribute is the HTML attribute lang. It tells browsers and assistive technology which language a page or passage is written in – lang="en", for example. Screen readers choose their voice and pronunciation from it. WCAG 3.1.1 requires it for the page, and 3.1.2 for passages in another language [1][2].
German: Sprachauszeichnung · Last reviewed: 27 September 2026
Why one attribute matters so much
A screen reader reads English text with German pronunciation if the page is marked as German – or not marked at all on a system set to German. "Checkout" becomes something nobody would recognise. The language attribute also helps translation tools, CSS hyphenation and search engines.
What WCAG requires
- 3.1.1 Language of Page (Level A): the main language of each page can be determined programmatically – in HTML through
<html lang="…">[1]. - 3.1.2 Language of Parts (Level AA): when a section or sentence switches language, it is marked up. Proper names, technical terms, words of indeterminate language and words that have become part of the surrounding language are exempt – "kindergarten" in English text needs no
langof its own [2].
Common mistakes
- No attribute at all, often in templates or on pages a CMS assembles.
- The wrong value: a German page with
lang="en"because the template came from an English theme. - Invalid codes, such as
lang="english"instead oflang="en". - Language switches with no markup: a quotation in German, an "Auf Deutsch" link, or a product description in another language.
In code
<!-- No language: pronounced per system setting -->
<html>
<!-- Page in English, a quotation in German -->
<html lang="en">
…
<blockquote lang="de">
Nichts über uns ohne uns.
</blockquote>
<a href="/de/" lang="de">Deutsch</a>
Valid values are BCP 47 language tags, such as en, de, en-GB or de-AT [3].
How Reviseberg handles it
Reviseberg uses axe-core to check that every page has a lang attribute with a valid value (rules html-has-lang, html-lang-valid, valid-lang). That settles WCAG 3.1.1 automatically. For 3.1.2, the check finds invalid values but not a foreign-language sentence with no markup at all. That is still a job for a person, so Reviseberg treats 3.1.2 as only partly testable by automation.
Related terms
Screen reader · Braille display · Semantic HTML · Plain language