Page with xml:lang set on the html and p elements Screen reader compatibility

HTML WCAG
Sep 11, 2022

Expected Result: works in a screen reader

Actual Result: causes problems in 32 screen reader / browser combinations

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'.

By default NVDA 2018 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.

Chrome/Edge used xml:lang on any element when calculating phrase language until Chromium 87. In Chrome/Edge 88 and later xml:lang on elements is ignored except on the html element for page language.

WCAG Technique: WCAG 3.1.1 WCAG 3.1.2

Code used for this test:


		<html xml:lang='fr'>
		<head> 
			<title>Addition Report</title>
		</head>
		<body>
			<p>Active table</p>
			<p xml:lang='de'>radio</p>
		</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.

100%80%60%40%20%0%201520162017201829%201925%202050%20210%20220%

Change History

Last updated: September 11, 2022

  • Bad NVDA with Chrome Causes problems in NVDA 2022.2
  • Bad NVDA with IE Causes problems from NVDA 2018.4 to NVDA 2019.2
  • Bad NVDA with FF Causes problems from NVDA 2018.4 to NVDA 2022.2
  • Bad JAWS with Chrome Causes problems in JAWS 2022.2207.25
  • Bad JAWS with IE Causes problems from JAWS 2018.1811.2 to JAWS 2019.1912.1
  • Bad JAWS with FF Causes problems from JAWS 2018.1811.2 to JAWS 2022.2207.25
  • Bad VoiceOver macOS Causes problems from VoiceOver macOS 10.13 to VoiceOver macOS 12.5
  • Bad VoiceOver iOS Causes problems from VoiceOver iOS 11.4 to VoiceOver iOS 15.6
Screen readerBrowserModeNotesWhat the user hears
Fail NVDA 2022.2Chrome 105 Reading Pronounced as French, xml:lang ignored at element level. Act-eef tab-le. Rad-yoh.
Fail NVDA 2022.2FF102 Reading Pronounced as English. Ignores xml:lang. Act-if tay-bill. Ray-day-oh.
Fail NVDA 2022.2Edge 105 Reading Pronounced as French, xml:lang ignored at element level. Act-eef tab-le. Rad-yoh.
Fail NVDA 2021.2Chrome 94 Reading Pronounced as French, xml:lang ignored at element level. Act-eef tab-le. Rad-yoh.
Fail NVDA 2021.2FF91 Reading Pronounced as English. Ignores xml:lang. Act-if tay-bill. Ray-day-oh.
Fail NVDA 2021.2Edge 94 Reading Pronounced as French, xml:lang ignored at element level. Act-eef tab-le. Rad-yoh.
OK NVDA 2020.2Chrome 86 Reading Pronounced as French and German, xml:lang used at page and element level. Act-eef tab-le. Rah-di-oh.
Fail NVDA 2020.2FF78 Reading Pronounced as English. Ignores xml:lang. Act-if tay-bill. Ray-day-oh.
OK NVDA 2020.2Edge 92 Reading Pronounced as French and German, xml:lang used at page and element level. Act-eef tab-le. Rah-di-oh.
OK NVDA 2019.2Chrome 79 Reading Pronounced as French and German. Act-eef tab-le. Rah-di-oh.
Fail NVDA 2019.2FF68 Reading Pronounced as English. Ignores xml:lang. Act-if tay-bill. Ray-day-oh.
Fail NVDA 2019.2IE11 Reading Pronounced as English. Ignores xml:lang. Act-if tay-bill. Ray-day-oh.
OK NVDA 2018.4Chrome 73 Reading Pronounced as French and German. Act-eef tab-le. Rah-di-oh.
Fail NVDA 2018.4FF60 Reading Pronounced as English. Ignores xml:lang. Act-if tay-bill. Ray-day-oh.
Fail NVDA 2018.4IE11 Reading Pronounced as English. Ignores xml:lang. Act-if tay-bill. Ray-day-oh.
Fail JAWS 2022.2207.25Chrome 105 Reading Pronounced as French, xml:lang ignored at element level. Act-eef tab-le. Rad-yoh.
Fail JAWS 2022.2207.25FF102 Reading Pronounced as English. Ignores xml:lang. Act-if tay-bill. Ray-day-oh.
Fail JAWS 2022.2207.25Edge 105 Reading Pronounced as French, xml:lang ignored at element level. Act-eef tab-le. Rad-yoh.
Fail JAWS 2021.2107.12Chrome 94 Reading Pronounced as French, xml:lang ignored at element level. Act-eef tab-le. Rad-yoh.
Fail JAWS 2021.2107.12FF91 Reading Pronounced as English. Ignores xml:lang. Act-if tay-bill. Ray-day-oh.
Fail JAWS 2021.2107.12Edge 94 Reading Pronounced as French, xml:lang ignored at element level. Act-eef tab-le. Rad-yoh.
OK JAWS 2020.2008.24Chrome 86 Reading Pronounced as French and German. Act-eef tab-le. Rah-di-oh.
Fail JAWS 2020.2008.24FF78 Reading Pronounced as English. Ignores xml:lang. Act-if tay-bill. Ray-day-oh.
OK JAWS 2020.2008.24Edge 92 Reading Pronounced as French and German. Act-eef tab-le. Rah-di-oh.
OK JAWS 2019.1912.1Chrome 79 Reading Pronounced as French and German. Act-eef tab-le. Rah-di-oh.
Fail JAWS 2019.1912.1FF68 Reading Pronounced as English. Ignores xml:lang. Act-if tay-bill. Ray-day-oh.
Fail JAWS 2019.1912.1IE11 Reading Pronounced as English. Ignores xml:lang. Act-if tay-bill. Ray-day-oh.
OK JAWS 2018.1811.2Chrome 73 Reading Pronounced as French and German. Act-eef tab-le. Rah-di-oh.
Fail JAWS 2018.1811.2FF60 Reading Pronounced as English. Ignores xml:lang. Act-if tay-bill. Ray-day-oh.
Fail JAWS 2018.1811.2IE11 Reading Pronounced as English. Ignores xml:lang. Act-if tay-bill. Ray-day-oh.
Fail VoiceOver macOS 12.5Safari 15.6 Reading Pronounced as English. Ignores xml:lang. Act-if tay-bill. Ray-day-oh.
Fail VoiceOver macOS 11.5Safari 15.0 Reading Pronounced as English. Ignores xml:lang. Act-if tay-bill. Ray-day-oh.
Fail VoiceOver macOS 10.15Safari 14.1 Reading Pronounced as English. Ignores xml:lang. Act-if tay-bill. Ray-day-oh.
Fail VoiceOver macOS 10.14Safari 13.0 Reading Pronounced as English. Ignores xml:lang. Act-if tay-bill. Ray-day-oh.
Fail VoiceOver macOS 10.13Safari 12.1 Reading Pronounced as English. Ignores xml:lang. Act-if tay-bill. Ray-day-oh.
Fail VoiceOver iOS 15.6Safari iOS 15.6TouchPronounced as English. Ignores xml:lang. Act-if tay-bill. Ray-day-oh.
Fail VoiceOver iOS 14.7Safari iOS 14.7TouchPronounced as English. Ignores xml:lang. Act-if tay-bill. Ray-day-oh.
Fail VoiceOver iOS 13.3Safari iOS 13.3TouchPronounced as English. Ignores xml:lang. Act-if tay-bill. Ray-day-oh.
Fail VoiceOver iOS 12.4Safari iOS 12.4TouchPronounced as English. Ignores xml:lang. Act-if tay-bill. Ray-day-oh.
Fail VoiceOver iOS 11.4Safari iOS 11.4TouchPronounced as English. Ignores xml:lang. Act-if tay-bill. Ray-day-oh.

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