WCAG A/AA requirement Priority: Moderate
The page declares two different languages
The page's <html> tag has both a lang and an xml:lang attribute, and they name different languages, for example lang="de" and xml:lang="en".
This text was translated automatically and has not been reviewed by a native speaker yet.
Why it matters to your customers
Software that reads xml:lang may treat a German page as English. Screen readers can then read product names, prices and checkout instructions with the wrong pronunciation, and translation tools may misidentify the language.
Who is affected
- blind customers
- screen reader users
- people who use read-aloud or translation tools
How to fix it
Make both attributes name the same language, such as lang="pl" xml:lang="pl". In a normal HTML5 page the xml:lang attribute is not needed, so the simplest fix is to remove it and keep a correct lang. Check every language version of the shop: the mismatch often appears only on translated pages.
On Shopify
Rare in current themes. Usually caused by an older or heavily customised layout file with a hard-coded xml:lang while lang comes from the shop language. Fix or remove xml:lang in the theme's layout Liquid file.
On Shoptet (CZ)
Rare; if it appears, it comes from the template or a customisation of the page header. Ask Shoptet or a Shoptet partner to align or remove xml:lang.
On PrestaShop
Usually in older or customised themes where xml:lang is hard-coded in the layout .tpl template. Make it use the same language ISO code as lang, or remove it.
On WooCommerce
Usually in older themes with an XHTML-style header where xml:lang is hard-coded, or when a multilingual plugin changes only lang. Fix the <html> tag in the child theme's header template, ideally by outputting only language_attributes().
Standards
| Standard | Clause |
|---|---|
| WCAG 2.2 | 3.1.1 (A) Language of Page |
| WCAG 2.1 | 3.1.1 (A) Language of Page |
| WCAG 2.0 | 3.1.1 (A) Language of Page |
| EN 301 549 4.1.1 | 9.3.1.1 |
| EN 301 549 3.2.1 | 9.3.1.1 |
| Section 508 2017 | E205.4 |
| ДСТУ EN 301 549 2022 | 9.3.1.1 |
Automated check: axe-core rule html-xml-lang-mismatch.
dequeuniversity.com, github.com, www.w3.org
Related checks
-
Buttons and links are too small to tap easily
WCAG 2.5.8 AA
-
Form fields have no label
WCAG 4.1.2 A
-
Some vector graphics have no text description
WCAG 1.1.1 A
-
Some headings are only bold or large text
WCAG 1.3.1 A