Language

Language tags in: HTML, Word documents, PDFs

Document language and changes of language

If the language being used in a document is not specified it may cause problems for people who are using screen readers or Braille output. Most modern screen readers can speak multiple languages. If the language attribute has not been specified the text will be spoken in the screen reader’s default language, which will probably be American English.  This can cause problems in documents containing words or passages in a foreign language. The foreign words will be extremely difficult for screen reader users to understand, for example the French word for car “voiture” could be pronounced “voter” by a speech synthesizer that uses English as its primary language. Click on the loudspeaker for further examples:

""

Language tags in HTML

In HTML, screen readers can be given the information they need in order to pronounce documents correctly using the <lang=..> attribute, the language being specified by a two letter code given in ISO 639. This is particularly useful for language learning materials.

Language specification tags also allow Braille generators to substitute the appropriate control codes where language changes occur. This ensures that the Braille translation software will generate the correct characters (e.g. accented characters and umlauts). These control codes also prevent Braille contractions from being generated, which could further confuse the user.

Specifying the language for the whole document

If the whole document is written in a language other than English the header attribute in HTML can be used to show this:

<html lang="fr">
....rest of html document written in French...
</html>

Language changes within a document

For language changes within an html-generated document, the <lang> tag can be used along with the <q> quotation or <span> tags. Where appropriate the <q> tag can be used in conjunction with the lang= attribute as this, from the W3C site WCAG 1.0, demonstrates:

<p> And with a certain <span lang="fr"> je ne sais quoi</span> she entered the room. <q> My name is Natasha </q>, she said. <q lang="it"> Piacere </q>, he replied in impeccable Italian.

Example mixed language sound file

Alt Tags

Alt tags for images should also have language specified if this is different from the main core language. for example:

<p> <span lang="es"><img src="mexicanas.jpg" alt="los tres amigos"></span></p>

↑ to top

""

Language attributes in Word documents

Language attributes can be specified in Word for documents and individual words or sections. The language settings in your operating system (Windows , Mac OSX, Android etc), should by default set the default language attribute of your Word documents.

There are two ways to specify changes in language within Word documents:

  • Highlight the text for which the language needs to be specified and click on the language section of the bottom left toolbar (see diagram below left for Word 2007 for Windows and click for enlargement)

or

  • Select Review, and under Proofing, 'Select Language' (see diagram below right for Word 2007 for Windows and click for enlargement)
Using Language button in Word 2007 Using Select Language, under Proofing, Word 2007

↑ to top

""

Language attributes and PDF documents

Unfortunately language attributes that were specified in Word are not transferred across to PDF format when converting files with Adobe Acrobat Professional. Specifying the language attribute for entire documents is simple enough but specifying changes in language can be more challenging. In PDFs language changes can be made for individual headings, sentences or paragraphs, but not with any degree of consistent success for individual words or phrases.

IMPORTANT: Specifying document language, even if this is English, helps all screen readers assimilate the information contained within a file before it is read out. To specify the document language for a PDF document go to the File menu, select Properties and under Advanced, specify Language in the drop down box - see below:

Specifying PDF documant language

To specify the language for specific sentences or paragraphs, highlight the text, under Tools select Advanced Editing, Touch up Text Tool. Click on the text, then right click within the highlighted text box. Select Properties, and from within the TouchUp Properties box, select the Tag tab. Select the required language from the drop down menu and close the TouchUp Properties box. See below:

specify language for specific sections within a PDF

Click on speaker for example sound file of a PDF file read by JAWS with sentences and headings specified in different European languages.

↑ to top

""