Warning:
This wiki has been archived and is now read-only.
SC3-1-2-text
This test belongs to 3.1.2 Language of Parts.
Status
Previous versions
Contents
Description
This test checks that changes in human language are marked up correctly in the web content.
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
- HTML 4.01 Inheritance of language codes
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 applies only to visible text, i.e. the text of
alt
ortitle
-attributes is not checked.alt
-attributes are covered by 1.1.1 Non-text Content. - Single words in another language do not have to be marked as language changes.
- This test assumes that the language of the web content has been specified in the
lang
attribute of the element (see also SC3-1-2-lang). Thexml:lang
attribute is not taken into account because tests have shown, thatxml:lang
is ignored by screenreaders.
Test properties
Property | Possible values |
---|---|
Success Criterion | 3.1.2 Language of Parts |
Test mode | SemiAuto |
Test environment | DOM |
Test subject | single web page |
User expertise and skills | no prior knowledge |
User profile | Knowledge of the languages used in the web page |
Test procedure
Selector
earl:automatic
Select consecutive run of text to which a single language attribute applies.
L1 = language of the selected text as determined by HTML 4.01 Inheritance of language codes.
Note: This test is applied to natural language text. The test is not applicable to content of <script>
-elements, attribute values, and text contained in HTML comments.
Step 1
earl:automatic
Use a language identification algorithm to determine L2 = the language actually used in the selected text.
If L2 can not be determined by the algorithm.
Continue with Step 2.
If L2 is equal to L1, return
Property | Value |
---|---|
TestCase | SC312-text |
Identifier | SC312-text-pass1 |
Outcome | passed |
Pointer | position |
Info |
Else return
Property | Value |
---|---|
TestCase | SC312-text |
Identifier | SC312-text-fail1 |
Outcome | failed |
ErrorMessage | The language of the text is not specified correctly. |
Pointer | position |
Info | L1, L2 |
Step 2
earl:manual
Present the selected text to the user.
Question: Is L1 the only language used in this text?
Note that language codes should be presented in human readable form, e.g. using the description from the language subtag registry.
Help text: If the text contains a phrase or sentence in another language, please answer "no". If there are only single words in another language and the rest of the text is in L1, please answer "yes".
If yes, return
Property | Value |
---|---|
TestCase | SC312-text |
Identifier | SC312-text-pass2 |
Outcome | passed |
Pointer | position |
Info |
Else return
Property | Value |
---|---|
TestCase | SC312-text |
Identifier | SC312-text-fail2 |
Outcome | failed |
ErrorMessage | The language of the text is not specified correctly. |
Pointer | position |
Info | L1, L2 |