Warning:
    This wiki has been archived and is now read-only.
SC3-1-2-lang
From Automated WCAG Monitoring Community Group
								
												
				This test belongs to 3.1.2 Language of Parts.
Status
Previous versions
Contents
Description
This test checks that lang attributes within the body of a web page are correct.
Background
- H58: Using language attributes to identify changes in the human language
- eGovMon test for SC3.1.2
- BCP 47: Tags for the Identification of Languages
Assumptions
- The comparison of language-code does not look for exact matches. Technique H57 states: "Use of the primary code is important for this technique." which means that region subtags can be ignored in the comparison, i.e. "en-GB" is the same as "en".
-  This test checks the langattributes. Thexml:langattributes are not taken into account because tests have shown, thatxml:langis ignored by screenreaders. (Both Jaws 15 with FF and IE and NVDA with FF go by lang attribute, xml:lang is ignored.) Thexml:langattributes are checked by a separate test: SC3-1-2-xml-lang.
Test properties
| Property | Possible values | 
|---|---|
| Test name | Languages within the body | 
| Success Criterion | 3.1.2 Language of Parts | 
| Test mode | automatic | 
| Test environment | DOM | 
| Test subject | single web page | 
| User expertise and skills | |
| User profile | 
Test procedure
Selector
Test mode: 
earl:automaticdescendent-or-self::body[@lang]
This test is applied to all elements with lang attribute in the body of the web page (including the body element itself). 
Step 1
Test mode: 
earl:automaticL1 = value of lang attribute.
Compare L1 to BCP 47.
If L1 is not on the list, return
| Property | Value | 
|---|---|
| TestCase | SC312-lang | 
| Identifier | SC312-lang-fail1 | 
| Outcome | failed | 
| ErrorMessage | Unknown language code. | 
| Pointer | position | 
| Info | L1 | 
Note that this step also fails if L1 contains only whitespace or is empty.
Else, return
| Property | Value | 
|---|---|
| TestCase | SC312-lang | 
| Identifier | SC312-lang-pass1 | 
| Outcome | passed | 
| Pointer | position | 
| Info |