WCAG Success Criteria · Level AA
WCAG 3.1.2: Language of Parts
WCAG 3.1.2 requires that any passage, phrase, or section of web content written in a language different from the page's primary language must be programmatically identified using the lang attribute. This enables assistive technologies, especially screen readers, to switch pronunciation engines automatically and render content accurately for users who rely on audio output.
- Level AA
- Wcag
- Wcag 2 2 aa
- Understandable
- Accessibility
What This Rule Means
WCAG 3.1.2 — Language of Parts is a Level AA criterion under the Understandable principle. It builds directly on 3.1.1 (Language of Page), which requires that the primary language of an entire page be declared. Criterion 3.1.2 goes further: whenever a passage, phrase, or section of content is written in a language different from the page's default language, that portion must carry a lang attribute identifying its specific language.
In practical HTML terms, this means applying the lang attribute to any element that wraps a language switch. The attribute value must be a valid BCP 47 language tag — for example, lang='en' for English, lang='fr' for French, lang='de' for German, or lang='tr' for Turkish. Region subtags (such as lang='en-US' or lang='tr-TR') are permitted and encouraged when dialect-specific pronunciation matters.
A pass occurs when every distinct language segment that a human reader would perceive as belonging to a different language is wrapped in an element with the correct lang attribute. A fail occurs when a passage in a different language is present but carries no lang attribute, or carries an incorrect one — for instance, labelling a French sentence as lang='de'.
WCAG acknowledges three explicit exceptions to this criterion. First, proper nouns — personal names, brand names, geographic names — do not need language tagging even when they originate from another language. Second, technical terms that are recognized as vocabulary items within the primary language (such as the Latin phrase in vitro used in a medical English page) are exempt. Third, words of indeterminate language — words that have been absorbed so thoroughly into the primary language that their origin is ambiguous — are also exempt. These exceptions reflect the practical reality that many loanwords do not require a pronunciation switch to be understood correctly.
The lang attribute can be placed on any HTML element, including <span>, <p>, <div>, <blockquote>, <section>, or even <td> in a table cell. The attribute is inherited by all descendant elements, so tagging a high-level container is sufficient if an entire block is in the target language. You only need to tag individual inline elements when short phrases are interspersed within otherwise monolingual paragraphs.
Why It Matters
The primary beneficiaries of this criterion are screen reader users, particularly those who are blind or have low vision. Screen readers rely on text-to-speech (TTS) engines that are language-specific. When a Turkish screen reader encounters a French sentence without a lang='fr' attribute, it attempts to pronounce the French words using Turkish phonetic rules, producing output that is largely unintelligible. The listener may not even realize that a language switch has occurred — they simply hear garbled audio and lose comprehension of the content entirely.
Consider a real-world scenario common on Turkish e-commerce and tourism websites: a product page written in Turkish that includes the brand name and a short marketing slogan in English, followed by a legal disclaimer in French for European customers. Without language tagging on the English and French segments, a blind user relying on a Turkish TTS voice will hear three segments all pronounced as if they were Turkish. The English slogan may be guessable through phonetic similarity, but the French legal text becomes entirely incomprehensible — potentially causing the user to miss critical contractual or safety information.
Users with cognitive disabilities who rely on text-to-speech reading tools (not just dedicated screen readers) are also affected. Many mainstream reading-assistance browser extensions use the lang attribute to select the correct voice. Without it, the tool either ignores the language switch or defaults to a single voice for the entire page, undermining comprehension.
Beyond accessibility, correct language tagging provides measurable SEO benefits. Search engines use lang attributes to index multilingual content correctly, improving the likelihood that language-specific pages appear in geographically and linguistically targeted search results. Browsers also use the attribute to offer accurate translation suggestions, and spell-checking tools reference it to apply the right dictionary. In short, proper language marking benefits all users — not only those with disabilities.
It is estimated that over 2.2 billion people worldwide have some form of vision impairment, and tens of millions rely on screen readers daily. Multilingual web content is increasingly the norm in international markets, making Language of Parts compliance critical for any site that serves a global or multilingual audience.
Related Axe-core Rules
WCAG 3.1.2 requires manual testing because automated tools cannot reliably identify which portions of a page's text are written in a language different from the page default without applying natural language detection (NLP) algorithms — and even those can be uncertain with short phrases, proper nouns, and technical terminology.
- Manual inspection — language detection: Automated scanners such as axe-core can verify that the
langattribute on the<html>element is present and valid (covered by thehtml-has-langandhtml-lang-validrules), but they cannot read through the entire body of text and determine whether a given passage is linguistically French, German, or Japanese. A tool has no semantic understanding of whether the string "Bonjour tout le monde" is French or a made-up phrase, so it cannot flag the absence oflang='fr'on the surrounding element. - Manual inspection — incorrect lang values: If a developer has placed a
langattribute on an element but assigned the wrong language code (for example, marking Spanish text aslang='pt'), automated tools will see a valid BCP 47 tag and report no error. Only a human reviewer who reads both languages can identify the mismatch. - Manual inspection — scope of language changes: Even when
langattributes exist, a human must confirm that the attribute covers the full extent of the foreign-language passage — not just the first sentence, and not spilling into adjacent content that belongs to the primary language. Automated tools lack the reading comprehension to make this judgment.
How to Test
- Automated baseline scan: Run axe DevTools (browser extension or CI integration) or Google Lighthouse against the page. Look for any violations of
html-has-langorhtml-lang-valid— these indicate that even the page-level language declaration is missing or incorrect, which is a prerequisite issue to fix before addressing 3.1.2. Note that neither tool will flag missing inlinelangattributes, so this step only establishes a baseline. - Visual content audit: Read through the entire page content and identify every passage, phrase, or block that is visibly written in a language other than the declared page language. Maintain a list of these elements, noting their location in the DOM. Check each element (or its closest ancestor) for a
langattribute in the browser's DOM inspector (browser DevTools → Elements panel). Verify that the value is a valid BCP 47 tag matching the actual language of the content. - Screen reader test — NVDA + Firefox (Windows): Open the page with NVDA active using Firefox. Navigate through the content with the arrow keys, focusing on the foreign-language passages you identified. Listen carefully: NVDA should switch pronunciation automatically when it encounters a correctly tagged
langattribute. If the foreign text is read with the default language's pronunciation rules without any perceptible voice change, thelangattribute is likely missing or incorrect. - Screen reader test — JAWS + Chrome (Windows): With JAWS running in Chrome, use the virtual cursor to read through the page. JAWS's behaviour mirrors NVDA's — it will switch TTS engines based on
langvalues. Enable verbose speech mode to hear language announcements. Note any passages where the pronunciation sounds incorrect for the visible language. - Screen reader test — VoiceOver + Safari (macOS/iOS): Activate VoiceOver and navigate the page with VO+Right arrow. For mobile testing on iOS, swipe through content. VoiceOver in Safari also respects
langattributes and switches voices accordingly. If your device has voice packs installed for the expected foreign languages, you will hear a distinct voice change on correctly tagged elements. - BCP 47 tag validation: For any
langvalues you find, validate them against the IANA Language Subtag Registry or use an online BCP 47 validator. Common mistakes include usinglang='en-us'(lowercase region code is technically valid but unconventional) or invalid codes likelang='english'.
How to Fix
Inline foreign phrase in a Turkish paragraph — Incorrect
<p>
Bu ürün uluslararası standartlara uygundur ve
<em>state of the art</em> teknoloji kullanmaktadır.
</p>
Inline foreign phrase in a Turkish paragraph — Correct
<p>
Bu ürün uluslararası standartlara uygundur ve
<!-- lang='en' tells screen readers to switch to an English TTS engine -->
<em lang='en'>state of the art</em> teknoloji kullanmaktadır.
</p>
Multi-sentence block quotation in a foreign language — Incorrect
<blockquote>
<p>La liberté commence où l'ignorance finit.</p>
<p>— Victor Hugo</p>
</blockquote>
Multi-sentence block quotation in a foreign language — Correct
<!-- lang='fr' applied to the blockquote covers all descendant content -->
<blockquote lang='fr'>
<p>La liberté commence où l'ignorance finit.</p>
<p>— Victor Hugo</p>
</blockquote>
Bilingual navigation menu — Incorrect
<nav>
<ul>
<li><a href='/tr/anasayfa'>Anasayfa</a></li>
<li><a href='/en/home'>Home</a></li>
<li><a href='/de/startseite'>Startseite</a></li>
</ul>
</nav>
Bilingual navigation menu — Correct
<nav>
<ul>
<!-- Primary language (Turkish) needs no extra attribute if html lang='tr' -->
<li><a href='/tr/anasayfa'>Anasayfa</a></li>
<!-- English and German links receive their own lang attributes -->
<li><a href='/en/home' lang='en'>Home</a></li>
<li><a href='/de/startseite' lang='de'>Startseite</a></li>
</ul>
</nav>
Table with multilingual data cells — Incorrect
<table>
<tr>
<th>Ülke</th>
<th>Slogan</th>
</tr>
<tr>
<td>Fransa</td>
<td>Liberté, Égalité, Fraternité</td>
</tr>
<tr>
<td>Almanya</td>
<td>Einigkeit und Recht und Freiheit</td>
</tr>
</table>
Table with multilingual data cells — Correct
<table>
<tr>
<th>Ülke</th>
<th>Slogan</th>
</tr>
<!-- lang applied to individual td elements containing foreign text -->
<tr>
<td>Fransa</td>
<td lang='fr'>Liberté, Égalité, Fraternité</td>
</tr>
<tr>
<td>Almanya</td>
<td lang='de'>Einigkeit und Recht und Freiheit</td>
</tr>
</table>
Common Mistakes
- Omitting
langattributes on short inline phrases: Developers often tag large foreign-language sections but overlook short phrases like a two-word English marketing slogan embedded in an otherwise Turkish sentence. Even single-word foreign terms that are not exempt proper nouns or technical vocabulary require tagging. - Using an incorrect BCP 47 tag: Writing
lang='english',lang='turkish', orlang='français'instead of the correct ISO codes (lang='en',lang='tr',lang='fr') renders the attribute invalid and screen readers may ignore it entirely. - Relying on CSS or visual styling to imply a language switch: Changing font, color, or italicizing foreign text signals the language difference to sighted users but provides no programmatic information to assistive technologies. The
langattribute is the only mechanism that works for screen readers. - Assuming that screen reader users will "figure it out" from context: Expecting a blind user to deduce that a garbled-sounding passage is actually French because the surrounding Turkish text referenced France is an unreasonable expectation that shifts the burden of comprehension to the user.
- Tagging only the first element of a multi-element foreign block: If three consecutive
<p>elements contain a French passage, placinglang='fr'on only the first paragraph leaves the remaining two paragraphs untagged. The correct approach is either to wrap all three in a parent element withlang='fr'or to add the attribute to each paragraph individually. - Conflating proper nouns with full foreign-language phrases: The WCAG exception for proper nouns covers names like "Paris" or "Volkswagen" — not entire sentences or marketing copy written in French or German. Developers sometimes misapply this exception to justify skipping
langtagging on substantial foreign-language content. - Dynamically injected content missing language attributes: When foreign-language content is loaded via JavaScript (for example, a CMS-driven FAQ block or a translated product description fetched from an API), developers often forget to include the
langattribute in the injected markup. Server-side or client-side rendering pipelines must pass through language metadata alongside the text content. - Using
xml:langin HTML5 documents withoutlang: In XHTML contexts,xml:langwas the appropriate attribute. In HTML5,langis the correct attribute. Using onlyxml:langin an HTML5 document may work in some browsers but is not universally supported by all assistive technologies. - Placing
langon a too-broad container that also includes primary-language content: Wrapping a section that contains both Turkish and French text entirely inlang='fr'will cause the Turkish portions to be mispronounced. The attribute scope must match the language boundary precisely. - Not testing with actual screen readers after applying fixes: Developers frequently add
langattributes and consider the fix complete without verifying the actual TTS output. Testing with NVDA, JAWS, or VoiceOver is the only way to confirm that the pronunciation improvement is perceptible to end users.
Relation to Turkey's Accessibility Regulations
Turkey's Presidential Circular 2025/10, published in the Official Gazette No. 32933 on June 21, 2025, establishes a binding framework for digital accessibility across a wide range of public and private sector entities. The circular formally incorporates WCAG 2.2 as the technical standard, with Level AA conformance serving as the baseline requirement for legal compliance.
WCAG 3.1.2 — Language of Parts is a Level AA criterion, placing it squarely within the mandatory conformance target defined by the circular. Entities that operate multilingual websites — which is common in Turkey given the country's position as a crossroads of European, Middle Eastern, and Central Asian commerce — face a heightened obligation to implement this criterion correctly. A Turkish bank that publishes foreign currency terms in English, a telecom operator that includes roaming agreement clauses in German, or a hospital website that reproduces patient consent forms in Arabic must all ensure that every foreign-language passage is programmatically tagged.
The entity types covered by the circular include public institutions and agencies, e-commerce platforms, banks and financial institutions, hospitals and healthcare providers, telecommunications companies with 200,000 or more subscribers, travel agencies, private transport companies, and private schools authorized by the Ministry of National Education (MoNE). For all these entities, failure to meet Level AA conformance — including 3.1.2 — may result in administrative sanctions and ineligibility for the Accessibility Logo (Erişilebilirlik Logosu) issued by the Ministry of Family and Social Services.
The Erişilebilirlik Logosu is increasingly recognized as a trust signal in the Turkish market, particularly in e-commerce and financial services. Achieving and maintaining the logo requires demonstrated compliance with all Level AA criteria, and Language of Parts is particularly relevant for Turkish entities that serve international customers or publish legally binding documents in multiple languages. Given that Turkish law requires certain disclosures (such as consumer rights notices and financial product terms) to be comprehensible to users with disabilities, language tagging is not merely a technical best practice — it is part of the accessible communication obligation embedded in the circular's broader mandate.
Organizations seeking the logo are advised to conduct structured content audits to identify all foreign-language passages across their digital properties, implement a development process that enforces lang attribute application at the content management layer, and include Language of Parts in their regular accessibility testing protocols alongside automated and manual review cycles.
