Remove automatic language option from MathCAT speech settings#19910
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the “Automatic” language option from MathCAT speech settings, making English (en) the default and adding a config schema upgrade to migrate existing profiles off the old Auto value.
Changes:
- Removes “Auto” handling in MathCAT speech conversion / speech-style configuration and language-option population.
- Updates MathCAT language selection to always use the configured language preference (default
en). - Bumps config schema version and adds an upgrade step to migrate
math.speech.language = Autotoen.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
source/mathPres/MathCAT/speech.py |
Simplifies SSML→NVDA command conversion by removing MathCAT Language save/set/restore logic. |
source/mathPres/MathCAT/preferences.py |
Removes “Auto” fallback behavior when creating speech-style config entries. |
source/mathPres/MathCAT/MathCAT.py |
Stops passing MathML into getLanguageToUse, always using the configured language preference. |
source/mathPres/MathCAT/localization.py |
Removes “Automatic” from the language list and changes language resolution to fall back to en if Auto is encountered. |
source/config/profileUpgradeSteps.py / source/config/configSpec.py |
Bumps schema version to 22, changes default math speech language to en, and adds an upgrade step for Auto→en. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…into removeMathCatAutoLang
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
source/mathPres/MathCAT/localization.py:127
getLanguages()iteratesos.listdir()without sorting, so the language dropdown order becomes filesystem-dependent. Now that the leading "Auto" entry has been removed, the first entry (and any UI fallback that selects index 0) can vary across systems/runs. Consider sorting the collected languages (e.g., by code/description) and/or explicitly placing the default language (en) first to keep the UI deterministic and aligned with the new default.
languages: list[LanguageInfo] = []
addRegionalLanguages = _createAddRegionalLanguagesFunction(languages)
# populate the available language names in the dialog
# the implemented languages are in folders named using the relevant ISO 639-1
# code https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
languageDir: str = pathToLanguagesFolder()
for language in os.listdir(languageDir):
pathToLanguageDir: str = os.path.join(pathToLanguagesFolder(), language)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
seanbudd
approved these changes
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Closes #19811
I am opening this PR as a follow-up to #19888 at the request of @seanbudd
Summary of the issue:
The automatic language option for MathCAT speech was confusing and didn't respond as expected to speech voice/synthesizer language changes. (from #19888)
Description of user facing changes:
Removes the "Automatic" option from MathCAT speech. The default is now English. (from #19888)
Description of developer facing changes:
None
Description of development approach:
Removed the
_mathMlparameter fromgetLanguageToUse, the save/set/restore language pattern fromconvertSSMLTextForNVDA, and the "Auto" fallback in_createConfigForSpeechStyle. Added a config profile upgrade step to migratelanguage = Autotoen.Testing strategy:
Unit testing: added unit tests to
tests\unit\test_config.py.Manual testing: Set the math language to English, read math and made sure everything was behaving as before.
Then, tested with a variety of combinations of NVDA language, synthesizer language (with eSpeak), and math language.
Specifically, I tested:
In all cases, the math language option overrode the more general synth language and NVDA language options.
Known issues with pull request:
None
Code Review Checklist: