WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: Lang attributes not being respected by VoiceOver in select options?

for

Number of posts in this thread: 6 (In chronological order)

From: Alex Gonzalez
Date: Wed, Apr 20 2022 4:34PM
Subject: Lang attributes not being respected by VoiceOver in select options?
No previous message | Next message →

Hello,

I ran into an issue where lang attributes are not being respected by
VoiceOver when used on <option> elements inside of a <select> element.

An example of what I mean can be found at the following link:
https://a11ysupport.io/tests/html/html_option_element_with_lang.html

You'll notice when using VoiceOver the screen reader does not switch
pronunciation correctly based on which language it is reading even though
the lang attributes are properly set. It seems to read pages where the lang
attribute is set on the <html> element just fine however.

I was wondering if anyone knows of a work around or fix for this issue?

--
Alex Gonzalez (he/him) Software Engineer
Accessibility Advocate codeforamerica.org

From: glen walker
Date: Wed, Apr 20 2022 5:14PM
Subject: Re: Lang attributes not being respected by VoiceOver in select options?
← Previous message | Next message →

Hmm, interesting. I have the languages installed in my Voiceover settings
but none of them are used *except* for Chinese. I *do* hear the last
option in the select announced in Chinese. Not sure why just that one is
honored.

But I hear the same ignoring of the language with the option element with
JAWS and NVDA too, but all the languages are ignored, including Chinese.

I tried setting the language on the <select> element as well as the <label>
element. The label itself could be read in another language but when I
displayed the dropdown list, it switched back to English.

I'm not aware of a workaround. Just confirming your results, sorry.

From: jp Jamous
Date: Wed, Apr 20 2022 5:25PM
Subject: Re: Lang attributes not being respected by VoiceOver in select options?
← Previous message | Next message →

I have experienced certain behaviors with other components in the past. Have you tried adding the language to each <option> instead of the <select>? I would also recommend pressing Insert + spacebar followed by z, to load the JAWS default settings. That tends to help. Not sure why with my own personal settings, JAWS does not always switch the synthesizer. I typically don't change my settings from the default ones, except to readability preferences that do not get impacted by HTML. Yet, if I load the default settings, I always hear the change in synthesizers. It is worth trying that.


From: WebAIM-Forum < = EMAIL ADDRESS REMOVED = > On Behalf Of glen walker
Sent: Wednesday, April 20, 2022 6:15 PM
To: WebAIM Discussion List < = EMAIL ADDRESS REMOVED = >
Subject: Re: [WebAIM] Lang attributes not being respected by VoiceOver in select options?

Hmm, interesting. I have the languages installed in my Voiceover settings but none of them are used *except* for Chinese. I *do* hear the last option in the select announced in Chinese. Not sure why j
External ( = EMAIL ADDRESS REMOVED = <mailto: = EMAIL ADDRESS REMOVED = >)
INKY is learning...<https://protection.inkyphishfence.com/report?id=bmV0b3JnZnQxMDM2OTU1NC9qcEBqZXBlbHN5LmNvbS8zZDMzNDE5NDk3YTFmM2NkMzliMTM2ZDhkMDBjM2NiNS8xNjUwNDk2NTEyLjM5#keyÌb77326ed2dc7e59ac09e1890e240ff> Report This Email<https://protection.inkyphishfence.com/report?id=bmV0b3JnZnQxMDM2OTU1NC9qcEBqZXBlbHN5LmNvbS8zZDMzNDE5NDk3YTFmM2NkMzliMTM2ZDhkMDBjM2NiNS8xNjUwNDk2NTEyLjM5#keyÌb77326ed2dc7e59ac09e1890e240ff> FAQ<https://www.inky.com/banner-faq> GoDaddy Advanced Email Security, Powered by INKY<https://www.inky.com/protection-by-inky>


Hmm, interesting. I have the languages installed in my Voiceover settings

but none of them are used *except* for Chinese. I *do* hear the last

option in the select announced in Chinese. Not sure why just that one is

honored.



But I hear the same ignoring of the language with the option element with

JAWS and NVDA too, but all the languages are ignored, including Chinese.



I tried setting the language on the <select> element as well as the <label>

element. The label itself could be read in another language but when I

displayed the dropdown list, it switched back to English.



I'm not aware of a workaround. Just confirming your results, sorry.

From: David Farough
Date: Thu, Apr 21 2022 7:03AM
Subject: Re: Lang attributes not being respected by VoiceOver in select options?
← Previous message | Next message →

I tried this as well.
It appears to me that the screen reader may be speaking the contents of the edit rather than the option being selected.
Perhaps the best approach might be to modify the lang setting for the edit to match the option being selected.

Not sure that this would work however. The screen reader might not recognize the change of language without a virtual screen refresh.

From: jp Jamous
Date: Thu, Apr 21 2022 7:10AM
Subject: Re: Lang attributes not being respected by VoiceOver in select options?
← Previous message | Next message →

Try adding a
<option>
<span lang=”en”>
English
</span>
</option>

Try this one before giving up. 😊




From: WebAIM-Forum < = EMAIL ADDRESS REMOVED = > On Behalf Of David Farough
Sent: Thursday, April 21, 2022 8:04 AM
To: WebAIM Discussion List < = EMAIL ADDRESS REMOVED = >
Subject: Re: [WebAIM] Lang attributes not being respected by VoiceOver in select options?

I tried this as well. It appears to me that the screen reader may be speaking the contents of the edit rather than the option being selected. Perhaps the best approach might be to modify the lang sett
External ( = EMAIL ADDRESS REMOVED = <mailto: = EMAIL ADDRESS REMOVED = >)
INKY is learning...<https://protection.inkyphishfence.com/report?id=bmV0b3JnZnQxMDM2OTU1NC9qcEBqZXBlbHN5LmNvbS9kYmRiMThkNWI4OWYxNDRmNzM1ZmRmYjU2NDFmNDRjZS8xNjUwNTQ2MjM4LjU5#keyÃ3e87ab8cf5ff79cb42cd0bec4152c0> Report This Email<https://protection.inkyphishfence.com/report?id=bmV0b3JnZnQxMDM2OTU1NC9qcEBqZXBlbHN5LmNvbS9kYmRiMThkNWI4OWYxNDRmNzM1ZmRmYjU2NDFmNDRjZS8xNjUwNTQ2MjM4LjU5#keyÃ3e87ab8cf5ff79cb42cd0bec4152c0> FAQ<https://www.inky.com/banner-faq> GoDaddy Advanced Email Security, Powered by INKY<https://www.inky.com/protection-by-inky>


I tried this as well.

It appears to me that the screen reader may be speaking the contents of the edit rather than the option being selected.

Perhaps the best approach might be to modify the lang setting for the edit to match the option being selected.



Not sure that this would work however. The screen reader might not recognize the change of language without a virtual screen refresh.



From: Steve Green
Date: Thu, Apr 21 2022 8:38AM
Subject: Re: Lang attributes not being respected by VoiceOver in select options?
← Previous message | No next message

I think you are on to something here, David. When a combobox is open, the select element retains focus the whole time. It therefore would make sense that everything that screen readers say will use its "lang" attribute.

The options go into a "selected" state as you navigate through the list, but they do not receive focus. Modifying the "lang" attribute for the select element to match the selected option would work in principle, but there is no guarantee it will work in practice.

Steve Green
Managing Director
Test Partners Ltd