Goal
Ensure that any portion of content (paragraph, quote, phrase, or word) written in a language different from the default page language is correctly identified. This helps screen readers pronounce text accurately.
Key Points
- Apply the
lang
attribute to all non-default language content. - Includes:
- Quotes or phrases in another language
- Foreign words, product names, or technical terms
- Embedded content like code snippets or foreign-language instructions
- Improves text-to-speech pronunciation and translation accuracy.
Short Summary
Marking the language of specific content segments ensures assistive technologies can correctly interpret and pronounce them, improving accessibility for screen reader users.
Example Issue and Fix
Foreign phrase without language declaration
Fail
<p>We often say <q>c’est la vie</q> to accept situations.</p>
Pass
<p>We often say <q lang="fr">c’est la vie</q> to accept situations.</p>
Quick Checklist
- All content in a different language from the page has a
lang
attribute - Use
<span>
or<q>
for inline foreign words or phrases - Verify screen reader pronunciation after marking languages
- Nested content in iframes or widgets also specifies language if different
- Avoid leaving mixed-language content unmarked