liveBook · Manning

IETF BCP 47 language tag

As explained in Architecting Accessibility

An IETF BCP 47 language tag is a standardized identifier for a human language and optional regional or dialect variant.

An IETF BCP 47 language tag identifies the human language used on a page and can specify a regional variant. Correct language identification helps speech synthesizers pronounce text appropriately and braille translation software apply language-specific rules. 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>

The language selector uses language tags in lang and hreflang attributes for English, Spanish, and French links. section 4.2

How Architecting Accessibility covers it

How deep it goes
Defines language and regional tags, with examples, and applies them in HTML attributes.
Examples
Uses fr-ch and fr-be for regional variants and shows an English, Spanish, and French language selector.
What you can do after
Apply it via HTML lang and hreflang attributes to identify page and link languages.
How it connects
Connects language tags to HTML lang and hreflang attributes, multilingual pages, speech synthesis, and braille translation.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Architecting Accessibility. The section links point to the parts of the book it draws on.