- Any text in a language that is different to the default language of the page must be appropriately identified.
- Identifying the language is important for people who use screen readers or text-to-speech technology that converts text into synthetic speech.
- You must use the right language code to identify text otherwise screen readers or text-to-speech technology won't know which language you are talking about because it affects pronunication.
If you use foreign words and phrases in your content, you need to mark words or passages using the language attribute, as identified in Success Criterion 3.1.2 Language of parts:
The human language of each passage or phrase in the content can be programmatically determined except for proper names, technical terms, words of indeterminate language, and words or phrases that have become part of the vernacular of the immediately surrounding text. (Level AA)
The language attribute tells the screen reader what language to use so that it can pronounce the words correctly. Most screen readers support multiple languages and can switch between languages as they read out a page.
For example, if a French phrase appears in a page with English text, the screen reader will switch to French pronunciation for that phrase. However, if the French phrase isn't identified using the language attribute, the screen reader won't know to switch languages. Instead of the French phrase being read out using proper French pronunciation, the screen reader user will hear the French phrase in an English accent, which will result in mispronunciation.
Your developer should have set the default language of the page for you. That means that if your website is predominantly in English, then that will already be specified. It is your job to make sure that any content that you add that is in a different language is marked appropriately.