Skip to content

Remove automatic language option from MathCAT speech settings#19888

Closed
SaschaCowley wants to merge 2 commits into
betafrom
removeMathCatAutoLang
Closed

Remove automatic language option from MathCAT speech settings#19888
SaschaCowley wants to merge 2 commits into
betafrom
removeMathCatAutoLang

Conversation

@SaschaCowley
Copy link
Copy Markdown
Member

Link to issue number:

Closes #19811

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.

Description of user facing changes:

Removes the "Automatic" option from MathCAT speech. The default is now English.

Description of developer facing changes:

None

Description of development approach:

Removed calls pertaining to retrieving the speech language based on the speech language. Given how close we are to a final release, I have not touched any supporting code.
Set the default for config.conf["math"]["speech"]["language"] to "en" rather than "Auto".

Testing strategy:

Ran from source. Read math.
Changed the MathCAT speech language (to German). Read math and.
Changed language back to English and read math.
Overrode the math language to "Auto", saved the config, restarted NVDA, and read math.

Known issues with pull request:

MathCAT's "Auto" option (which pulls the language from the math tag) is still supported, though it is not surfaced in NVDA's GUI.

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.

@SaschaCowley SaschaCowley requested a review from a team as a code owner April 1, 2026 04:20
@SaschaCowley SaschaCowley requested a review from seanbudd April 1, 2026 04:20
@SaschaCowley SaschaCowley added this to the 2026.1 milestone Apr 1, 2026
mathLang = "en"
if mathLang not in mathConf["speech"]:
mathConf["speech"][mathLang] = {"speechStyle": ""}
return mathLang
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can you update source\mathPres\MathCAT\speech.py

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

convertSSMLTextForNVDA still needs to be updated

@@ -137,14 +137,6 @@ def getLanguages() -> list[LanguageInfo]:
languages: list[LanguageInfo] = []
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can you clean up other function referencing "Auto" e.g. getLanguageToUse getSpeechStyles

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I intentionally didn't to keep this PR as safe as possible. But sure

@SaschaCowley SaschaCowley requested a review from seanbudd April 1, 2026 05:24
"""Get the language preference, falling back to English if it is Auto.

:param mathMl: The MathML string to examine for language. Defaults to an empty string.
:param _mathMl: The MathML string to examine for language. Not used. Defaults to the empty string.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

let's just remove this?

mathLang = "en"
if mathLang not in mathConf["speech"]:
mathConf["speech"][mathLang] = {"speechStyle": ""}
return mathLang
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

convertSSMLTextForNVDA still needs to be updated

@CyrilleB79
Copy link
Copy Markdown
Contributor

@SaschaCowley, I have not yet tested but already have some questions:

  1. Have you tested modifying the math config without opening the math settings dialog, e.g. NVDA+control+R? This impacts both Language and Speech style options, maybe more. See MathCAT no longer honours Automatic language option when you change current synth language #19811 (comment) for STR. If this is not fixed, MathCAT no longer honours Automatic language option when you change current synth language #19811 cannot be considered fixed. If instead you have tested this successfully, please add this information in the initial description.

  2. I had my config math language set to "auto". When I display the math settings panel, the language is set to German although I have the following message logged:

DEBUGWARNING - mathPres.MathCAT.preferences._createConfigForSpeechStyle (08:04:01.619) - MainThread (10924):
Math language 'Auto' is not supported. defaulting to en for speech style

Note: my GUI, system and TTS are in French and German ("Allemand") is the first item of the math language list, before English ("Anglais").

@CyrilleB79
Copy link
Copy Markdown
Contributor

Sorry, ignore point 1. in my previous comment: I had not yet seen #19886.

RyanMcCleary added a commit to RyanMcCleary/nvda that referenced this pull request Apr 7, 2026
seanbudd pushed a commit that referenced this pull request Apr 8, 2026
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.
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.

3 participants