By default, the language of your web pages will be set to the language you’re primarily writing for (English, if you’re in Australia). So when you use foreign language words or phrases, you need to tag them as such.
Identifying language changes helps people:
- using screen readers (used by people with vision impairments); this software will use the right pronunciation rules for the language
- using text-to-speech software (used by people with reading or learning difficulties). If a foreign-language phrase is wrongly pronounced as an English word, this may make content impossible to understand
- recognise that an unfamiliar word or phrase is from a foreign language. That’s because it will be displayed with the appropriate character set, and show diacritical marks or the relevant alphabet.
How to tag foreign language
Content management systems don’t have a formatting tool to let you easily tag foreign language. You’ll have to edit the HTML source code, or get help from your web team.
Strictly speaking, you use a language attribute on a tag. The tag you apply the attribute to will depend on whether you are editing an HTML or XHTML page, and where the foreign language occurs in your content. Here are a couple of simple HTML examples with the language attribute of the relevant tag emphasised.
A French quotation on an English language page
La vérité vaut bien qu'on passe quelques années sans la trouver. Renard
German phrases on an English language page
<li><span lang="de">Hallo</span> (Hello)</li>
<li><span lang="de">Guten tag</span> (Good morning)</li>
<li><span lang="de">Guten abend</span> (Good evening)</li>
When foreign language tags are not necessary
You don’t have to tag foreign language when:
- words or phrases have become part of English. For example, many words of French origin, such as rendezvous, avante-garde and bon voyage, are now considered part of English.
- using technical terms common in certain professions—de facto or habeas corpus, in legal language for example
- the words are a proper name, like Medecins sans Frontieres.
- Language of parts – understanding success criterion 3.1.2
- Using language attributes to identify changes in the human language -technique H58
- Web Content Accessibility Guidelines 2.0