If a screen reader reads English text using French pronunciation rules, the words may be difficult to understand. The HTML lang attribute identifies the language of an element’s content so assistive technology can use an appropriate speech synthesizer. It also supplies language information for braille translation and search indexing. section 4.2
Set the page language
Put the main language on the html element: <html lang="en">. Do this for each page of a multilingual site, using that page’s language. Without lang, a screen reader may fall back to the user’s default language rather than the language of the page. section 2.5.1 section 4.2
Mark a change within the page
For a French passage on an otherwise English page, mark the passage itself: <div lang="fr"><p>J’aimerais parler français couramment</p></div>. The language value is an IETF BCP 47 tag, such as en or fr. section 4.2
<nav aria-label="Language Selector">
<ul class="lang-selector">
<li>
<a href="../en/index.html"
hreflang="en"
lang="en"
aria-current="page">English</a>
</li>
<li>
<a href="../es/index.html"
hreflang="es"
lang="es">Español</a>
</li>
<li>
<a href="../fr/index.html"
hreflang="fr"
lang="fr">Français</a>
</li>
</ul>
</nav>
This language selector marks each link’s visible language name with its own lang value; the page still needs its main language on the html element. section 4.2
