Please enable javascript to view this page in its intended format.

Queen's University

Web Standards and Accessibility Guide

Foreign Languages

Standard: All foreign language content must use language declarations.

Today's modern web browsers, as well as most current versions of adaptive technology, support multi-language documents. However, for the proper rendering of this web content to these technologies, the appropriate language(s) must be indicated (or declared) programmatically. This will allow, for example, screen-reading technologies to use the appropriate language files when reading aloud (i.e. allowing the computer voice to pronounce foreign words properly instead of reading them phonetically in English). Many, if not most, of these tools also support the capacity to change language modes in real time as required, provided they have been properly encoded.

There are numerous methods of making these declarations; the ultimate choice of method is dependent on the amount of foreign-language text on any given web document. From whole pages to paragraphs, quotations, phrases or individual words, each of these semantic constructs may be assigned the HTML "lang" attribute, which will state the specified language used. For example, a whole paragraph written in French would be marked:

<p lang="fr">Dans les années 1960, on a créé les premiers outils d'apprentissage, et on a fait preuve d'une plus grande créativité dans la conception des films didactiques dont la portée a été élargie pour rejoindre les enfants en milieu scolaire.</p>

A sentence containing just a few foreign words would be marked:

"In English we say 'hello'. In French we say '<span lang="fr" >bonjour</span>'. In Spanish we say '<span lang="sp">hola</span>.

By default, the majority of documents on the Queens University web site are in English, and so the programmatic declaration will be achieved via the web templates being used, in the <meta> block, or via the web server headers, set by the machine administrators


Kingston, Ontario, Canada. K7L 3N6. 613.533.2000