In our previous post, we discussed why it’s important to set a default language for your page. Setting a default language ensures browsers and other user agents, including assistive technologies like screen readers, present text and linguistic content correctly.
That article described the most basic, or level A, standard for this rule. Here, we’ll talk about what you’d need to do to satisfy the AA-level standard.
Under WCAG 3.1.1, if your page contains text in multiple languages, you would set the default language to whichever appears most prominently. However, WCAG 3.2.2 asks you to go one step further and make sure the language of every passage or phrase on your page can be set in the underlying coding. Doing so will allow a higher level of accuracy for both visual browsers and assistive technologies, like screen readers, braille displays, and speech synthesizers.
Let’s take a step back and put on our “linguist” cap for a moment. We take for granted that everyday speech contains many words, phrases, and names that originally come from other languages. These are commonly called “loanwords”. They have been incorporated into our own vernacular over time through common usage, and in most cases we pronounce them according to our own language’s rules (unless we’re trying to show off).
In these cases, you would simply leave those words or phrases in the overall default language of the page. Specifically, these exceptions include: