Overview
Many screen reader applications support multiple languages, and can switch on-the-fly between supported languages, using the appropriate voice and rule set for the current language. However, currently screen readers are unable to determine what language a document is written in, or if the language changes within that document. Therefore it is important for authors to define the language of the document or web page, and to identify the language of any blocks of text that deviate from that default language.
Identifying the language of the entire web page or document, as well as its individual parts, helps to ensure that screen readers will correctly pronounce the content.
Techniques
Defining Language in HTML
In HTML the language of content is identified using the lang attribute, the value of which is a standard BCP 47 Language Code . For example the following tag identifies the entire HTML document as being an English:
<html lang="en">
If a paragraph, table cell, list item, or any other block of text changes from the default language of the page, that too must be marked up with a lang attribute. For example, imagine that our English document contains a short paragraph in French, as in the following example:
<p lang="fr">Vaut mieux prévenir que guérir.</p>
Defining Language in Canvas
Currently the rich text editor in Canvas does not provide a toolbar widget for identifying the language of selected text. Therefore, if content changes from the default language, the only way to identify the language of the content is to do so in the HTML Editor using HTML code as explained in the previous section. Follow these steps:
- Compose the content in the rich text editor within Canvas.
- Click the “HTML Editor” link immediately above the editor.
- In the HTML Editor, add an appropriate lang attribute to any HTML element that contains foreign text.
Defining Language in Adobe PDF
The following steps apply specifically to Adobe Acrobat Pro XI. The idea is the same in other recent versions of Acrobat Pro as well, but specific steps may vary slightly.
Follow these steps to define the document language of a PDF in Adobe Acrobat Pro:
- From File Menu, select Properties.
- In the “Document Properties” dialog, click the Advanced tab.
- Near the bottom of the dialog, select the document language using the Language combo box.
Follow these steps to define the language of particular parts within a PDF file using Adobe Acrobat Pro :
- Open the Tags pane by going to View > Show/Hide > Navigation Panes > Tags.
- Select the foreign language text in the document.
- In the tags pane, click on the Tags menu and select “Find Tag from Selection”.
- The tag for the selected text will be highlighted in the Tag pane. Right click it, and select Properties.
- In the Object Properties dialog, select the “Tags” tab, and select the language of the text from the Language combo box.
References
- WCAG 2.0 Success Criterion 3.1.1 Language of Page (Level A)
- WCAG 2.0 Success Criterion 3.1.2 Language of Parts (Level AA)