Report the language of the text been read#17685
Conversation
Co-authored-by: Cyrille Bougot <cyrille.bougot2@laposte.net>
|
Seems that, when pressing c to go to the combo box in the old add-ons website, the preferences word is in English but, if it's not spoken, the lastReportedLanguage is set to English, and this causes that the language of the word English in the combo box is not reported. I don't know if this may be fixed with the pre_speech extension point in some way. |
|
@nvdaes, regarding language translations I guess it would be interesting to list all the specific / corner cases. Then you will be able to determine if they should be handled separately or if they can be ignored. For example I have the following questions:
|
|
@CyrilleB79 , should the corner cases be addressed in languageHandler.getLanguageDescription? |
Maybe not; just mentioning in case everyone is aware of it so to decide what to do (accept as is or fix). |
|
Let's way for comments on this about corner cases, to see how to document it, or if saying that the language description would be reported is enough. |
|
I think that the experience when using this feature with quick navigation or moving the focus with tab is not good, when the language description is reported, then for example the text of a heading and a link, and then the link state like "visited link". In this case "visited link" is pronnounced with a bad entonation, tested with eSpeak-NG. And also, listening the language description for each element, since "visited link" is pronnounced in the default language, is too much. |
|
Now for me the user experience is acceptable, not perfect, since in say all NVDA can report the language for new paragraphs. See [In-Process 7th February 2025](https://www.nvaccess.org/post/in-process-7th-february-2025/ Copy control+shift+cClose). |
|
Please mark this as a ready for review if it's ready |
|
Thanks, I plan to continue working on this the next weekend. I stopped working on this since this was not labelled with concept approved, so I thought that this was not prioritized. |
|
Ah, we are waiting on the implementation to develop |
See test results for failed build of commit c059805765 |
|
Now we use getLanguageDescription from languageHandler and all seem to be right. |
See test results for failed build of commit 3699afdc8f |
See test results for failed build of commit b8c1f2666f |
|
@seanbudd , I think that these tests take more than 15 minutes, and that these chrome cases, though don't cover all possible configuration, consider relevant situations:
I don't think we should add all the possible combinations of configurations. |
| ) | ||
|
|
||
|
|
||
| def test_reportNotSupportedLanguageWithoutOtherLanguages(): |
There was a problem hiding this comment.
I think we need just one more test - report language changes on and report not supported set to speech.
If you are concerned around system test time length, I would encourage moving this to a separate test suite i.e. new python/robot file. You might have to factor out some stuff from chrome tests to it's own more generic module.
Or turn chromeTests into a submodule with multiple python test suites corresponding to separate robot files.
This means in GitHub actions we can parallelize it.
I really think we should avoid adding to chromeTests, as we need to modularize it. But I don't want the burden of this work to be on you, i.e. this part is an optional PR review comment.
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
|
Thank you @seanbudd . Since you approved this, I think it's better to split tests in a different issue/PR. So for now I won't perform this work. |
Qchristensen
left a comment
There was a problem hiding this comment.
Looks good, just two small changes (been -> being)
Co-authored-by: Quentin Christensen <quentin@nvaccess.org>
Co-authored-by: Quentin Christensen <quentin@nvaccess.org>
See test results for failed build of commit 43f030d6e9 |
Link to issue number:
Fixes #17664
Summary of the issue:
Users may want to know the language of the text been read, and if the current synthesizer can switch to that language.
Description of user facing changes
Description of development approach
speech/__init__.py, a function is registered (and unregistered) with the filter_speechSequence extension point, to insert the language description (or language code if the description is not available), when alangChangeCommandis found in the sequence to be spoken. The language description won't be inserted if the language command is the last item of the speech sequence, or if lang is None, or if it's the last reported language, or ifreportLanguageandreportNotSupportedLanguageoptions areFalse. ASpeechSequencemember has been added to the SpeechState class to track the last reported language, as well as another function to check and report if the language is supported by the current synthesizer.globalCommands.py, a script has been added to report the language of the character at caret.Testing strategy:
Tested locally and in the Codepen sample provided in this PR.
Known issues with pull request:
If beep option is chosen to report not supported languages, Occasionally, it's possible to hear beeps when focus changes in web browsers without been notified about the not supported language, though this is not happening after restarting the computer
Code Review Checklist:
@coderabbitai summary