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.
Fix it with AI
Copy this prompt into ChatGPT, Claude or Copilot and add the HTML of the element. Check the answer before you publish it.
You are an experienced web developer and accessibility specialist. Fix this accessibility problem on my website so that it meets WCAG 2.2 level AA.
Website: [https://…]
## Problem: Some text is marked with a wrong language code
WCAG 2.2 3.1.2 (AA)
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.
**How to fix:** 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.
## Elements found by the automated check
[Paste the HTML of the element here, or the selector from the Pandus report]
## Requirements
- Change only what is needed; keep the design and how the site works.
- Do not add accessibility overlays or widgets; fix the code or the content.
- Show the corrected code and say in which template or file it goes.
- Explain how to check the fix with the keyboard and a screen reader.
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
Read next
WCAG success criterion
Guides and tools
- WCAG 2.2 AA checklist for online shops
- HTML accessibility checker (WCAG 2.2)
- Free WCAG checker for WCAG 2.2 AA
Help articles
-
How to read a report and what to fix first
What each part of the report means and how to turn it into a to-do list for your developer.
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