Preview Modes: Lang Attribute

  • Updated

Why Use this Preview Mode?

Developers should define the natural language of a document to ensure that screen readers and other user agents understand what language the document should be interpreted in. Specifically, if a document contains multiple inline language choices, screen readers and other assistive technology types must know what the default language type is to ensure they can appropriately switch between languages. If the lang attribute is not used or is mislabeled, assistive technologies may misinterpret the content. This preview mode allows testers to easily evaluate the language is specified for all content.

How does the Preview Mode work?

This preview mode allows users to view a list of all elements that have a language specified. Any element with the lang attribute will be displayed in the list in Access Assistant. Users may select any element in the list to highlight it on the page. Users may select the Highlight All Lang Attributes button to highlight all items on the page that have a lang attribute specified.

Testers should evaluate all highlighted elements to determine that the correct language is specified. Testers should also evaluate all content that is in a different language from the default but has not been highlighted by the preview mode. This would indicate that a lang attribute was not appropriately specified for that content.

How do I use this Preview Mode?

For every page being tested, evaluate the contents of the page with language attributes highlighted. This can be done with this Preview Mode as follows:

  1. Launch Access Assistant from the site that is being tested and navigate to a page.
  2. In Access Assistant, navigate to the project and report where violation instances will be reported and find the module for the page being tested OR create the module if the page has not yet been tested at all.
  3. In Access Assistant, select the Preview Modes button in the toolbar header bar.
  4. Select the "Lang Attribute" link on the subsequent page.
  5. To highlight all language attributes, select the Highlight All Lang Attributes. If you want to inspect a particular element that has a lang attribute specified, select the item in the list. The value specified for each lang attribute will be displayed with the element.

    Toggle Lang Attributes Page

  6. Evaluate the page and determine whether the language attribute has been specified for all elements with a language different from the default document language, and that the specified language matches the written language. Add an instance for any elements that do not meet the above best practices:
    1. Select the Manual Test button in the module toolbar.
    2. Filter the Best Practices to those of Media Type, Language and Content.
    3. Select the appropriate Best Practice. Possible Best Practices include:
      1. Ensure the language of a document is set
      2. Ensure changes in natural language are identified inline
  1. On the subsequent screen, select the Add Instance button and complete the form to create a violation instance for the page or elements on the page that are in violation.


Was this article helpful?

0 out of 0 found this helpful