The human language of each passage or phrase in the content can be programmatically determined. (Level AA)

Rationale

The purpose of this checkpoint is to ensure that user agents can correctly present content written in multiple languages, using the presentation and pronunciation rules for that language. More specifically, a language setting change must occur when a portion of the content’s language changes from the primary language.

Note: There are some software and non-web document technologies where there is no assistive technology supported method for marking the language for the different passages or phrases in content, and it would not be possible to meet this requirement with those technologies.

Exception: Proper names, technical terms, words of indeterminate language, and words or phrases that have become part of the vernacular of the immediately surrounding text are excluded from this checkpoint.

Refer to Understanding SC 3.1.2 for more information (external link to WCAG).

Development Techniques

Review the General techniques as well as other tabs applicable to your technology.  Prioritize the use of technology-specific techniques, and implement the General techniques as needed. You are always required to find, understand and implement accessible code techniques to meet the checkpoint. The documented techniques and supplements are not exhaustive; they illustrate acceptable ways to achieve the spirit of the checkpoint. If numbered, techniques are in order of preference, with recommended techniques listed first. Where used, IBM information that complements the WCAG techniques is indicated as supplemental.

General techniques

Any item in this section represents a technique deemed sufficient. Where used, IBM information that complements the WCAG techniques is indicated as supplemental.

General supplements

Use the “locale / language” setting or an accessibility-supported method for exposing the human language of each passages or phrase

If available, use the language or locale setting, or an accessibility-supported method, for exposing the human language of your content.

Web (HTML, ARIA, CSS) techniques

In addition to the General techniques, any item in this section represents a technique deemed sufficient.

Web supplements

The following examples and comments provide additional information beyond that available in the WCAG techniques. 

H58: Using language attributes to identify changes in the human language

Use available tools to confirm that the lang attribute conforms to BCP 47: Tags for the Identification of Languages (link resides outside of ibm.com) or its successor. See the IANA Language Subtag Registry (link resides outside of ibm.com) for more information.

Mobile (iOS) techniques

There are no Native iOS techniques that can be used to meet this checkpoint.

Note: iOS native applications are not capable of specifying a language for a subportion of content. See 3.1.1 Language of Page for details on how Native applications use the user preferred locale / language setting for the language of the entire page. Native iOS applications that require a language change within the content will fail this checkpoint. Hybrid applications meet this requirement when they set the language of the content section using the lang attribute of the <html> element.

Eclipse techniques

Instructions: The Eclipse technique in this section represents a technique deemed sufficient for meeting this checkpoint (3.1.2).

Implement an AccessibleAttributeListener to return language

Add an org.eclipse.swt.accessibility.AccessibleAttributeListener to the Accessible of a text object to return the language of the text to assistive technology (AT) through the getTextAttributes method. The getTextAttributes method returns an array of alternating key and value strings that represent additional attributes including language in the attributes field of the AccessibleTextAttributeEvent.

@Override
public void getTextAttributes(AccessibleTextAttributeEvent e){
e.attributes = new String[] {
"language", "en-US"
};
}

The IAccessible2 Text Attributes specification defines the attributes currently supported and recognized by ATs.

Note: Language tag must follow the format outlined by IETF RFC 4646.

Windows-based (MSAA+IA2) techniques

Instructions: The Windows-based (MSAA + IA2) technique in this section represents a technique deemed sufficient for meeting this checkpoint (31.2).

Return language through attributes method of IAccessibleText

Return language through the attributes method of the IAccessibleText interface. As outlined in the IAccessible2 Text Attributes specification, the attributes method returns a string of attribute:value pairs separated by semicolons, for example, "language:en-US;attribute:value". See the Formatting section of the specification for further details.

Note: The language tag must follow the format outlined by IETF RFC 4646.


Most links in this checklist reside outside ibm.com at the Web Content Accessibility Guidelines (WCAG) 2.0. W3C Recommendation 11 December 2008: http://www.w3.org/TR/WCAG20/

Copyright © 1994-2017 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University, Beihang University). All Rights Reserved.

Copyright © 2001, 2017 IBM Corporation