-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust definition of valid language subtag (de46e4, bf051a, 5b7ae0) #1106
Changes from all commits
a361252
92866b0
9a30e6a
c5980ba
1545adc
5041f05
559cb4d
0ed0653
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,11 @@ For each test target, the `lang` attribute has a [valid language subtag](#valid- | |
|
||
## Assumptions | ||
|
||
This rule assumes that the presence of a `lang` attribute is being used to comply to WCAG. This rule doesn't test if the attribute is needed to comply to WCAG. | ||
- This rule assumes that the presence of a `lang` attribute is being used to comply to WCAG. This rule doesn't test if the attribute is needed to comply to WCAG. | ||
|
||
- This rule assumes that user agents and assistive technologies can programmatically determine [valid language subtags](#valid-language-subtag) even if these do not conform to the [BCP 47][] syntax. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a reasonable assumption - BCP 47 has an algorithm for determining best matching language in 'Matching of Language Tags' at the end of BCP 47:
Even if an implementor hasn't read this part of the spec, it's still likely they'll implement it because it's easy to implement and fairly obvious. |
||
|
||
- This rule assumes that [grandfathered tags][] are not used as these will not be recognized as [valid language subtags](#valid-language-subtag). | ||
|
||
## Accessibility Support | ||
|
||
|
@@ -59,6 +63,14 @@ This `html` element has a `lang` attribute whose value is a [valid][valid langua | |
<html lang="fr"></html> | ||
``` | ||
|
||
#### Passed Example 2 | ||
|
||
This `html` element has a `lang` attribute value that is a [valid language subtag][] even though the [region subtag][] is not. | ||
|
||
```html | ||
<html lang="en-US-GB"></html> | ||
``` | ||
|
||
### Failed | ||
|
||
#### Failed Example 1 | ||
|
@@ -71,21 +83,13 @@ This `html` element has a `lang` attribute whose value is not a [valid language | |
|
||
#### Failed Example 2 | ||
|
||
This `html` element has a `lang` attribute whose value is not a [valid language subtag][]. Even though the [primary language subtag][] is valid, the [region subtag] is not. | ||
|
||
```html | ||
<html lang="en-US-GB"></html> | ||
``` | ||
|
||
#### Failed Example 3 | ||
|
||
This `html` element has a `lang` attribute whose value is not a [valid language subtag][]. | ||
|
||
```html | ||
<html lang="123"></html> | ||
``` | ||
|
||
#### Failed Example 4 | ||
#### Failed Example 3 | ||
|
||
This `html` element has a `lang` attribute whose value is not a [valid language subtag][]. | ||
|
||
|
@@ -106,3 +110,5 @@ This rule does not apply to `svg` elements. | |
[primary language subtag]: https://tools.ietf.org/html/bcp47#section-2.2.1 'Definition of primary language subtag' | ||
[region subtag]: https://tools.ietf.org/html/bcp47#section-2.2.4 'Definition of region subtag' | ||
[valid language subtag]: #valid-language-subtag 'Definition of valid language subtag' | ||
[grandfathered tags]: https://tools.ietf.org/html/bcp47#section-2.2.8 | ||
[bcp 47]: https://tools.ietf.org/html/bcp47#section-2.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is right - BCP 47 has an algorithm for determining best matching language in 'Matching of Language Tags' at the end of BCP 47:
So lookup order is
en-US-GB
toen-US
toen