Skip to content

Remove automatic language option from MathCAT speech settings#19910

Merged
seanbudd merged 11 commits into
nvaccess:betafrom
RyanMcCleary:removeMathCatAutoLang
Apr 8, 2026
Merged

Remove automatic language option from MathCAT speech settings#19910
seanbudd merged 11 commits into
nvaccess:betafrom
RyanMcCleary:removeMathCatAutoLang

Conversation

@RyanMcCleary
Copy link
Copy Markdown
Contributor

@RyanMcCleary RyanMcCleary commented Apr 7, 2026

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 _mathMl parameter from getLanguageToUse, the save/set/restore language pattern from convertSSMLTextForNVDA, and the "Auto" fallback in _createConfigForSpeechStyle. Added a config profile upgrade step to migrate language = Auto to en.

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:

  • NVDA language of English, synth language of Spanish, math language of Spanish
  • NVDA language of English, synth language of Spanish, math language of English
  • NVDA language of English, synth language of Spanish, math language of English
  • NVDA language of English, synth language of French, math language of Dutch
  • NVDA language of Dutch, synth language of Dutch, math language of Dutch
  • NVDA language of Dutch, synth language of English, math language of Spanish
  • NVDA language of Dutch, synth language of Chinese (cantonese), math language of German

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:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@RyanMcCleary RyanMcCleary marked this pull request as ready for review April 7, 2026 06:02
@RyanMcCleary RyanMcCleary requested a review from a team as a code owner April 7, 2026 06:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 = Auto to en.

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 Autoen.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread source/mathPres/MathCAT/localization.py Outdated
Comment thread source/mathPres/MathCAT/localization.py
Comment thread source/mathPres/MathCAT/preferences.py
Comment thread source/config/profileUpgradeSteps.py
@RyanMcCleary RyanMcCleary marked this pull request as draft April 7, 2026 06:23
@RyanMcCleary RyanMcCleary marked this pull request as ready for review April 8, 2026 03:53
@RyanMcCleary RyanMcCleary requested a review from Copilot April 8, 2026 03:53
@SaschaCowley SaschaCowley added this to the 2026.1 milestone Apr 8, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() iterates os.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.

Comment thread source/config/profileUpgradeSteps.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Member

@SaschaCowley SaschaCowley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @RyanMcCleary

@seanbudd seanbudd merged commit f6c5b00 into nvaccess:beta Apr 8, 2026
73 of 75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants