Accessible Technology

Identifying Language of a Document and its Parts


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.


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:

  1. Compose the content in the rich text editor within Canvas.
  2. Click the “HTML Editor” link immediately above the editor.
  3. 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:

  1. From File Menu, select Properties.
  2. In the “Document Properties” dialog, click the Advanced tab.
  3. Near the bottom of the dialog, select the document language using the Language combo box.

Screen shot of Document Properties dialog, Advanced tab, Language field set to English
Follow these steps to define the language of particular parts within a PDF file using Adobe Acrobat Pro :

  1. Open the Tags pane by going to View > Show/Hide > Navigation Panes > Tags.
  2. Select the foreign language text in the document.
  3. In the tags pane, click on the Tags menu and select “Find Tag from Selection”.
  4. The tag for the selected text will be highlighted in the Tag pane. Right click it, and select Properties.
  5. In the Object Properties dialog, select the “Tags” tab, and select the language of the text from the Language combo box.

Screen shot of Object Properties dialog, used to change language to French for a selected paragraph that's in French