Skip to content
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

Handling of Unknown and Invalid Language Tags #2294

Open
WilcoFiers opened this issue Feb 7, 2025 · 0 comments
Open

Handling of Unknown and Invalid Language Tags #2294

WilcoFiers opened this issue Feb 7, 2025 · 0 comments
Labels
accessibility support Accessibility support testing and tracking

Comments

@WilcoFiers
Copy link
Member

Accessibility support

There are differences in how assistive technologies handle unknown and invalid language tags. Some will default to the language of the page, whereas others will default to the closest ancestor with a valid lang attribute.

ACT Rules

Test cases

Test case 1

Testing handling of invalid and unknown language tags

<html lang="en">
	<!-- Valid language tag -->
	<p lang="fr">Bonjour le monde!</p>

	<!-- Invalid language tag -->
	<p lang="french">Hello World!</p>

	<!-- Unknown language tag -->
	<p lang="xyz">Hello World!</p>

	<!-- Nested invalid within valid -->
	<div lang="es">
		<p>¡Hola Mundo!</p>
		<p lang="spanish">¡Hola!</p>
	</div>

	<!-- Invalid parent with valid child -->
	<div lang="invalid-tag">
		<p>Some text</p>
		<p lang="de">Hallo Welt!</p>
	</div>

	<!-- Empty language tag -->
	<p lang="">Hello World!</p>

	<!-- Malformed language tag -->
	<p lang="en-">Hello World!</p>
</html>

Test case

Test instructions

  1. Load the test case in different browsers
  2. Test with different assistive technologies
  3. For each scenario, check:
    • How the language is announced
    • What language voice/accent is used
    • If it falls back to page language
    • If it inherits from valid ancestors
  4. Expected results:
    • Valid tags should be announced correctly
    • Invalid tags should be handled consistently
    • Inheritance from ancestors should work
    • Fallback behavior should be predictable

External links

Test results

Please report test results in a comment below. Please use the following format:

## Test case 1

- Date: ...
- Operating system: ..., version ...
- Browser: ..., version ...
- Assistive technology: ..., version ...
- Results for each scenario:
  1. Valid tag (fr): ... (announced/voice used)
  2. Invalid tag (french): ... (fallback behavior)
  3. Unknown tag (xyz): ... (fallback behavior)
  4. Nested invalid in valid: ... (inheritance behavior)
  5. Invalid parent with valid child: ... (inheritance behavior)
  6. Empty tag: ... (fallback behavior)
  7. Malformed tag: ... (fallback behavior)
- Fallback consistency: ... (consistent/inconsistent)
- Inheritance behavior: ... (working/not working)
- Test result: Passed / Failed (if failed, how was it different from expected?)
@WilcoFiers WilcoFiers added the accessibility support Accessibility support testing and tracking label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility support Accessibility support testing and tracking
Projects
None yet
Development

No branches or pull requests

1 participant