WCAG A/AA requirement Priority: Moderate
Some text is marked with a wrong language code
A part of the page, for example a language switcher, a quote or a block of text in another language, declares a language code that does not exist, such as "ua" instead of "uk" or a typo.
This text was translated automatically and has not been reviewed by a native speaker yet.
Why it matters to your customers
Screen readers change pronunciation based on this code. With an invalid code they may read that part with the wrong voice, so language options, product names or reviews in another language can become hard to understand.
Who is affected
- blind customers
- screen reader users
- people who use read-aloud or translation tools
How to fix it
Use valid BCP 47 codes in every lang attribute, such as "en", "de", "pl", "uk", "cs" or "de-AT". Common mistakes are "ua" instead of "uk" for Ukrainian, "cz" instead of "cs" for Czech, "gr" instead of "el" for Greek, "dk" instead of "da" for Danish, and underscores ("de_DE" instead of "de-DE"). In a language switcher, give each language name the code of that language.
On Shopify
Often in the language or country selector in the header or footer Liquid snippets, or in translation apps that add lang attributes. Check the codes that are printed and fix them in the snippet or in the app settings.
On Shoptet (CZ)
Usually in the template's language switcher or in custom HTML. Check the language settings first, then ask Shoptet or a partner about the template.
On PrestaShop
Usually in the language selector module or hard-coded in a .tpl template; also check the ISO codes of the shop languages in the back office.
On WooCommerce
Usually from a multilingual plugin's language switcher, a page builder setting or HTML with a hard-coded lang attribute. Check the language codes configured in the multilingual plugin first.
Standards
| Standard | Clause |
|---|---|
| WCAG 2.2 | 3.1.2 (AA) Language of Parts |
| WCAG 2.1 | 3.1.2 (AA) Language of Parts |
| WCAG 2.0 | 3.1.2 (AA) Language of Parts |
| EN 301 549 4.1.1 | 9.3.1.2 |
| EN 301 549 3.2.1 | 9.3.1.2 |
| Section 508 2017 | E205.4 |
| ДСТУ EN 301 549 2022 | 9.3.1.2 |
Automated check: axe-core rule valid-lang.
dequeuniversity.com, github.com, www.w3.org
Related checks
-
Links in text look like normal text
WCAG 1.4.1 A
-
The page uses outdated blinking-text markup
WCAG 2.2.2 A
-
The whole page is hidden from screen readers
WCAG 1.3.1 A
-
Some links do not say where they go
WCAG 2.4.4 A