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.
Language on Webpages
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 content management systems
WordPress, Drupal, and other content management systems all have a rich content editor for authoring content. Most, if not all, of these products automatically add a lang
attribute to the <html>
element on all pages within a website. The default language of the website can be specified in the website settings.
Unfortunately, few if any rich content editors provide a mechanism for identifying the language of parts within a page. Therefore, the only way to specify the language of parts of the page is to switch to your editor’s HTML view and add lang
attributes to the outer HTML element of any foreign language content, as explained in the preceding section. After doing so and saving the page, be sure to inspect your source code to be sure your editor preserved the code you added. If your editor is stripping out lang attributes after you’ve added them, talk to your website admin, as this is likely a configurable setting.
Language in Documents
Techniques for Microsoft Word
In Microsoft Office, select Review > Language from the application menu to define the default language. To define a different language for part of the document, select each foreign language individually, then select Review > Language to define the language for each.
NOTE: Currently language settings only affect the accessibility of the Word document itself. They do not survive when exported to PDF. If PDF is the final format in which you intend to distribute your document, you will need to define language in the PDF directly using Adobe Acrobat Pro.
Language in D2L
The default language of a D2L course
In D2L, language can be defined at the course level, within the course Settings. This affects all of the built-in content in D2L for that course, including the course menu items, button labels, and other text. The underlying HTML is properly coded so screen readers, if they support the language of the course, will pronounce all content correctly.
Defining language of parts in D2L
Currently, the text editor in D2Ldoes not provide a means for identifying the language of selected text that differs from the language of the page. 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.