Language of parts - accessibility for web writers

If you use foreign language words or phrases in your content, you need to identify the foreign language using the lang attribute.

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

<p lang="fr"> La vérité vaut bien qu'on passe quelques années sans la trouver. Renard </p>

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.

Learn web content accessibility

Make sure a broad audience can use your content. Our course teaches how to create content that meets WCAG 2.1 guidelines.

Book a course at https://4syllables.com.au/