黑料网

Skip to main content

In html, the lang attribute is used to specify the language of a web page. This is required for accessibility purposes as it helps to ensure that screen readers will correctly pronounce the content.

All pages in the School of Medicine (SOM) web system are tagged with the English language code. If content in another language is added to the SOM web system, that content needs to be properly tagged. This can be accomplished by adding the lang attribute to html elements such as paragraph or header tags.

<p lang="en">This is some content.</p>

<h2 lang="en">This is some content.</h2>

For Spanish, the language code is es. The html would look like this:

<p lang="es">This is some content.</p>

A list of other acceptable language codes can be found on this .


How To

To view and modify the html of a page, select the Text tab in the editor and add the lang attribute to the correct block(s) of text.

Screenshot highlighting the location of the text tab in the editor.


Defining the Language In Documents

Identifying the language in documents such as PDFs and Word documents is also important and is required to meet accessibility guidelines.

  • .
  • .
  • The University of Washington’s web page shows how to set the language for both pdfs and Word documents.
  • 黑料网鈥檚 Digital Accessibility Office (DAO) provides documentation and training to help you make your documents accessible. View their or sign up for their .

References

requires that web pages specify the default language of the page.

requires that pages with parts in different languages have the languages of those parts specified too.

– there is a great audio recording demonstrating the issues a screen reader has pronouncing English text that has the language attribute of “cs” (Czech).