diff --git a/custom-words.txt b/custom-words.txt index 0745a42b1c..2ca75eafad 100644 --- a/custom-words.txt +++ b/custom-words.txt @@ -83,6 +83,7 @@ Zehe auditorily conferatur # Latin, expansion of "cf." dyscalculia +Español # Spanish genericizing linearization look-alikes diff --git a/understanding/20/language-of-parts.html b/understanding/20/language-of-parts.html index 7ebf618259..d6aa108aa7 100644 --- a/understanding/20/language-of-parts.html +++ b/understanding/20/language-of-parts.html @@ -127,14 +127,39 @@

Alternative language links

... <li><a href="..." lang="zh-hant">繁體中文</a></li> </ul> + +

Element content used as accessible name

+

When content is used as the accessible name of an element, the correct language should be specified on that element. This helps assistive technologies pronounce it accurately.

+

This link may be announced with an English accent, mispronouncing "Español".

+
<a href="/es/"><span lang="es">Español</span></a>
+

This version correctly applies the Spanish language to the element, ensuring "Español" is pronounced with a Spanish accent.

+
<a href="/es/" lang="es"><span>Español</span></a>
+
+

Although marking only the span with a different language (as in the first example) is theoretically correct, current user agents and assistive + technologies have limited and inconsistent support for handling language changes as part of their accessible name calculation and exposition. + Since the span is the sole content of the link and contributes entirely to its accessible name, setting the language on the parent + a element (as in the second example) is more reliable and ensures that screen readers pronounce the content correctly.

+
+ +

Element content in multiple languages used as accessible name

+

When content includes multiple languages, any child elements that use a different language must have their own lang attribute.

+

This example assumes the page's default language is English. The main text of the link is in English, but it includes the original Italian title of a poem. The Italian portion is correctly marked with lang="it".

+
<a href="/la-divina-commedia.html">Read this book: <span lang="it">La Divina Commedia</span></a>
+
+

Current user agents and assistive technologies have limited and inconsistent support for handling language changes as part of their accessible name calculation and exposition. + Since the accessible name of this link contains multiple languages, it is required to mark each portion with the appropriate lang, either inherited or set explicitly, + while being aware that assistive technologies may not always render the languages correctly.

+

"Podcast" used in a French sentence

Because "podcast" is part of the vernacular of the immediately surrounding text in the following excerpt, "À l'occasion de l'exposition "Energie éternelle. 1500 ans d'art indien", le Palais des Beaux-Arts de Bruxelles a lancé son premier podcast. Vous pouvez télécharger ce podcast au format M4A et MP3", no indication of language change is required.

The element's content and attribute values are in different languages

-

This example assumes that the page's default content is in English. The link's title attribute is in English, but the nested span element that contains the word Español has a lang="es" attribute.

-
<a title="Spanish" href="qa-html-language-declarations-es.html"><span lang="es">Español</span></a>
+

This example assumes that the page's default content is in English. The link's title attribute is in English, but the nested span element that contains the words La Divina Commedia has a lang="it" attribute.

+ +
<a title="Opens in a new tab" href="/la-divina-commedia.html" target="_blank">Read this book: <span lang="it">La Divina Commedia</span></a>
+