standards-support
standards-support copied to clipboard
Alt text for image within figure does not read in proper language when img tag has proper lang attribute
Summary
If I have an image and set the language attribute of the img, the alt text reads in that language. UNLESS that image happens to be inside a figure tag. Then the language of the page for some reason takes over and the alt text is mispronounced. In order to get the alt text to read in the proper language I have to set the lang attribute of the figure tag, too. Which then means that if the figcaption is in the base language of the page but the alt text is not, I have to ALSO set the language attribute of the figcaption back to the base page language since I had to set the figure to the secondary language of the alt text. All of that should be unnecessary. Note: NVDA has no problem with this.
Expected result
Page is in Spanish. Alt text is in English. Image caption is in Spanish. Code should be able to follow this pattern:
Actual result
With that code, "hello" is pronounced as if it were a Spanish word.
To get the alt text to pronounce in English and the caption to pronounce in Spanish I have to do extra code, as follows:
JAWS version and build number
2022.2112.24
Operating System and version
Windows 10 enterprise
Browser and version:
Chrome 97.0.4692.99