nvaccess / nvda

NVDA, the free and open source Screen Reader for Microsoft Windows
https://www.nvaccess.org/
Other
2.12k stars 638 forks source link

Automatic language switching doesn't work for aria-label #16285

Open SamKacer opened 8 months ago

SamKacer commented 8 months ago

Steps to reproduce:

  1. Turn on "Automatic language switching" in "Speech" settings.
  2. Save following html as a page and open in google chrome or brave
<button lang="EN">
    Hello, world!
</button><br />
<button lang="ES">
    Hola, mundo!
</button><br />
<button lang="EN" aria-label="Goodbye world">
</button><br />
<button lang="ES" aria-label="Adios, world!">
</button>

Actual behavior:

  1. Hello, world button is read in english
  2. Hola mundo button is read in spanish
  3. Goodbye world is read in english
  4. Adios mundo button is read in english (or whatever language is set the Speech synthesizer is set to)

Expected behavior:

The 4th button (Adios, mundo) should also be read in spanish, similarly to the second (Hola, mundo) button. The difference between the two buttons is the correctly behaving one has the text inside the button element, whereas the incorrectly behaving button has the text inside the aria-label attribute.

Having language switching work properly for these cases would greatly improve the user experience of using Duolingo and probably other language learning sites that properly annotate content but often use aria-labels.

(Note: As I am writing this, I decided to try this in Firefox and there it actually works correctly)

NVDA logs, crash dumps and other attachments:

System configuration

NVDA installed/portable/running from source: portable

NVDA version: 2023.3.2

Windows version: Windows 11

Name and version of other software in use when reproducing the issue:

Google Chrome latest Brave browser latest Firefox

Other information about your system:

Other questions

Does the issue still occur after restarting your computer?

Yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

Same in 2022.4

If NVDA add-ons are disabled, is your problem still occurring?

Yes

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

SamKacer commented 8 months ago

Apologies, submitted prematurely, I am editing the comment now

SamKacer commented 8 months ago

Ok, finished editing initial comment