Valid body lang attribute
Last updated:
Created by:
Success Criterion:
Last updated:
Created by:
Success Criterion:
This rule checks that lang
or xml:lang
attributes on elements within the body
of a web page has a valid language subtag.
This conformance rule relates to:
Any DOM element, within the body
of a webpage with a non-empty lang
or xml:lang
attribute.
The lang
and xml:lang
attributes have a valid language subtag if the attribute is non-empty.
There are currently no assumptions
The lang
attribute specified has a non-empty value & a valid primary language subtag.
The xml:lang
attribute specified has a non-empty value & a valid primary language subtag.
The lang
attribute specified has a non-empty value & a valid primary language subtag. The region section in the value is ignored by the rule.
The lang
and xml:lang
attribute specified has a non-empty value & a valid primary language subtag.
The lang
attribute value is not a valid primary language subtag.
The xml:lang
attribute value is not a valid primary language subtag.
The lang
attribute value has a valid primary language subtag, but a syntactically invalid region subtag.
The rule applies to elements with the body
of a webpage. html
elements are ignored by the rule.
An empty value for lang
attribute is ignored by this rule, as the applicability specifies only non-empty values.
An empty value for xml:lang
attribute is ignored by this rule, as the applicability specifies only non-empty values.
A string of characters (text) is considered “non-empty” if it contains 1 or more characters that are contained within any of the following unicode categories:
For more details on unicode categories, check out www.fileformat.info/info/unicode/category/
A text string following the syntax as defined in BCP 47, with a primary language from the language subtag registry.
DOM Tree
Contributing is open to anyone. We welcome any new issues or pull requests for changes. Auto WCAG Rules has conference calls every 4 weeks. If you are interested in becoming an active contributor or reviewer, we ask that you join the Auto WCAG Rules community group through the W3C Website. This requires setting up a W3C account, may require approval by the organization you work for if they are a W3C member.
Learn more about contributing to Auto WCAG Rules Join the Auto WCAG Rules community group now!