Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix a bug causing NVDA to use the wrong language when announcing selected/unselected symbols. #7687
Summary of the issue:
When languages of the currently selected voice and of NVDA itself
Description of how this pull request fixes the issue:
There was a function called "getCurrentLanguage" already present in speech.py. It just needed to be used instead of LanguageHandler to determine the locale used when reading the selected text.
I have tested this on the english language version of NVDA and polish espeak and I can confirm that it works correctly now.
Change log entry:
Sorry if this is a duplicate, but it seems my email reply didn't go through, at least I can't see it on the page.
Overall this looks ok. However this causes the unit tests to fail, so this will need to be updated before we can accept the PR. To run the tests run
Also, I would like this to be tested with the new version of espeak that is currently incubating (on the
I've just tested it with the next branch and, as expected, it works exactly the same because it's an NVDA issue that can be observed when using espeak but it's not unique to one synthesizer, it can be observed with other synths too, for example ivona2 on sapi5. That synth also communicates to NVDA about what language it speaks so the issue affects it too. I've provided my instructions for espeak because every NVDA instance has one available but this was only meant as an easily-reproducible example. I'l look into the unit tests too. At a first glance, it seems that now a synthesizer is required to determine the language and the tests fail because it's not available in the testing environment. Providing a mock and rewriting the relevant method so that it can handle this case properly and revert to the old behavior when needed seem like good approaches to solve this problem.