text/html
page with mismatching lang
and xml:lang
on the html
element
Screen reader compatibility
Expected Result: works in a screen reader
Actual Result: works in all tested screen readers
In English 'active table' is pronounced 'act-if tay-bill'. In French 'active table' is pronounced 'act-eef tab-le'. In English 'radio' is pronounced 'ray-day-oh'. In French 'radio' is pronounced 'rad-yoh'. In German 'radio' is pronounced 'rah-di-oh'. In English 'dame' is pronounced 'daim'. In French 'dame' is pronounced 'damm'. In German 'dame' is pronounced 'dam-he'.
By default NVDA uses Windows OneCore voices, which only support language switching if the appropriate Windows language pack is installed. Changing NVDA settings to use the eSpeak voice allows language switching without additional language packs.
WCAG Technique: WCAG 3.1.1 WCAG 3.1.2
Code used for this test:
<html lang='fr' xml:lang='de'>
<head>
<title>Test for mismatching lang and xml:lang</title>
<meta charset='utf-8'>
<link rel='stylesheet' href='SR-content-lang.css'>
<style>
div:lang(fr)::before { content: "Un, deux, trois"; }
div:lang(de)::before { content: "Eins, zwei, drei"; }
</style>
</head>
<body>
<h1 lang='en'>Following elements inherit page language - hover to view CSS :lang()</h1>
<p>garage</p>
<p>double</p>
<p>dame</p>
<div></div>
</body>
</html>
Reliability Trend
This graph shows reliability over time for this code in NVDA, JAWS and Voiceover. Other screen readers don't have enough historical data yet to plot trends.
Change History
Last updated: November 26, 2024
NVDA with Chrome Stable - OK from NVDA 2022.2 to NVDA 2024.4
NVDA with FF Stable - OK from NVDA 2022.2 to NVDA 2024.4
JAWS with Chrome Stable - OK from JAWS 2022.2207.25 to JAWS 2024.2409.2
JAWS with FF Stable - OK from JAWS 2022.2207.25 to JAWS 2024.2409.2
VoiceOver macOS Stable - OK from VoiceOver macOS 12.5 to VoiceOver macOS 14.6
VoiceOver iOS Stable - OK from VoiceOver iOS 15.6 to VoiceOver iOS 17.7
Screen reader | Browser | Mode | Notes | What the user hears |
---|---|---|---|---|
![]() | Chrome 131 | Reading | Speech pronounced as lang=fr, and CSS matches :lang(fr). | Ga-raj. Doo-ble. Damm. Un, deux, trois. |
![]() | FF 128 | Reading | Speech pronounced as lang=fr, and CSS matches :lang(fr). | Ga-raj. Doo-ble. Damm. Un, deux, trois. |
![]() | Edge 131 | Reading | Speech pronounced as lang=fr, and CSS matches :lang(fr). | Ga-raj. Doo-ble. Damm. Un, deux, trois. |
![]() | Chrome 120 | Reading | Speech pronounced as lang=fr, and CSS matches :lang(fr). | Ga-raj. Doo-ble. Damm. Un, deux, trois. |
![]() | FF 115 | Reading | Speech pronounced as lang=fr, and CSS matches :lang(fr). | Ga-raj. Doo-ble. Damm. Un, deux, trois. |
![]() | Edge 120 | Reading | Speech pronounced as lang=fr, and CSS matches :lang(fr). | Ga-raj. Doo-ble. Damm. Un, deux, trois. |
![]() | Chrome 105 | Reading | Speech pronounced as lang=fr, and CSS matches :lang(fr). | Ga-raj. Doo-ble. Damm. Un, deux, trois. |
![]() | FF 102 | Reading | Speech pronounced as lang=fr, and CSS matches :lang(fr). | Ga-raj. Doo-ble. Damm. Un, deux, trois. |
![]() | Edge 105 | Reading | Speech pronounced as lang=fr, and CSS matches :lang(fr). | Ga-raj. Doo-ble. Damm. Un, deux, trois. |
![]() | Chrome 131 | Reading | Speech pronounced as lang=fr, and CSS matches :lang(fr). | Ga-raj. Doo-ble. Damm. Un, deux, trois. |
![]() | FF 128 | Reading | Speech pronounced as lang=fr, and CSS matches :lang(fr). | Ga-raj. Doo-ble. Damm. Un, deux, trois. |
![]() | Edge 131 | Reading | Speech pronounced as lang=fr, and CSS matches :lang(fr). | Ga-raj. Doo-ble. Damm. Un, deux, trois. |
![]() | Chrome 120 | Reading | Speech pronounced as lang=fr, and CSS matches :lang(fr). | Ga-raj. Doo-ble. Damm. Un, deux, trois. |
![]() | FF 115 | Reading | Speech pronounced as lang=fr, and CSS matches :lang(fr). | Ga-raj. Doo-ble. Damm. Un, deux, trois. |
![]() | Edge 120 | Reading | Speech pronounced as lang=fr, and CSS matches :lang(fr). | Ga-raj. Doo-ble. Damm. Un, deux, trois. |
![]() | Chrome 105 | Reading | Speech pronounced as lang=fr, and CSS matches :lang(fr). | Ga-raj. Doo-ble. Damm. Un, deux, trois. |
![]() | FF 102 | Reading | Speech pronounced as lang=fr, and CSS matches :lang(fr). | Ga-raj. Doo-ble. Damm. Un, deux, trois. |
![]() | Edge 105 | Reading | Speech pronounced as lang=fr, and CSS matches :lang(fr). | Ga-raj. Doo-ble. Damm. Un, deux, trois. |
![]() | Safari 17.6 | Reading | Speech pronounced as lang=fr, and CSS matches :lang(fr). | Ga-raj. Doo-ble. Damm. Un, deux, trois. |
![]() | Safari 16.6 | Reading | Speech pronounced as lang=fr, and CSS matches :lang(fr). | Ga-raj. Doo-ble. Damm. Un, deux, trois. |
![]() | Safari 15.6 | Reading | Speech pronounced as lang=fr, and CSS matches :lang(fr). | Ga-raj. Doo-ble. Damm. Un, deux, trois. |
![]() | Safari iOS 17.7 | Touch | Speech pronounced as lang=fr, and CSS matches :lang(fr). | Ga-raj. Doo-ble. Damm. Un, deux, trois. |
![]() | Safari iOS 16.6 | Touch | Speech pronounced as lang=fr, and CSS matches :lang(fr). | Ga-raj. Doo-ble. Damm. Un, deux, trois. |
![]() | Safari iOS 15.6 | Touch | Speech pronounced as lang=fr, and CSS matches :lang(fr). | Ga-raj. Doo-ble. Damm. Un, deux, trois. |
SortSite rules: AccPageLangMissing AccPhraseLangMissing
Test notes
All tests were carried out with screen reader factory settings. JAWS in particular has a wide variety of settings controlling exactly what gets spoken.
Screen readers allow users to interact in different modes, and can produce very different results in each mode. The modes used in these tests are:
- Reading Content read using the “read next” command in a screen reader
- Tabbing Content read using the “tab” key in a screen reader
- Heading Content read using the “next heading” key in a screen reader
- Touch Content read when touching an area of screen on a mobile device
In the “What the user hears” column:
- Commas represent short pauses in screen reader voicing
- Full Stops represent places where voicing stops, and the “read next” or “tab” or “next heading” command is pressed again
- Ellipsis … represent a long pause in voicing
- (Brackets) represent voicing that requires a keystroke to hear