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

[Image v3] Add a lang attribute on image that contain text in foreign language #2728

Open
renow-luxembourg opened this issue Apr 16, 2024 · 1 comment

Comments

@renow-luxembourg
Copy link
Contributor

renow-luxembourg commented Apr 16, 2024

Feature Request

Current Behavior :
Some informative image contain text in foreign language.
If we follow the WCAG/RGAA/RAWeb1 rules, the alternative text should contain at least the visible texte of the informative image.
But for the moment, in the image component, we can't define a language for the alternative text.
This aims to cause that the image alternative is not well rendered to assistive tool (like the NVDA screen reader)

Expected behavior/code :
We should be able to add a lang attribute for each image.

Environment

Possible Solution :
Add a lang attribute on the 'img' tag based on the language defined in the "advanced" tab of the asset property

Additional context :
WCAG 2.1 : Technique H37 (https://www.w3.org/WAI/WCAG21/Techniques/html/H37)
WCAG 2.1 : 3.1.2 Language of Parts (https://www.w3.org/WAI/WCAG21/Understanding/language-of-parts)
WCAG 2.1 : Technique H58 (https://www.w3.org/WAI/WCAG21/Techniques/html/H58)
RGAA 4.1.2 / RAWeb 1 : 8.7.1 https://accessibilite.public.lu/fr/raweb1/criteres.html#test-8-7-1 (in french)
RGAA 4.1.2 / RAWeb 1 : 1.1.1 https://accessibilite.public.lu/fr/raweb1/criteres.html#test-1-1-1 (in french)

@renow-luxembourg
Copy link
Contributor Author

What I would like to achieve:

  1. Get the content of ./jcr:content/metadata/dc:language from the Image DAM properties
  2. Compare this value with the current page language
  3. If value are different, add a lang attribut on the img tag

What do you think of the following contribution?
main...renow-luxembourg:aem-core-wcm-components:renow_fix_img_lang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant