Skip to content

Use translated strings for driver settings in 32 bit sapi synthDrivers#19562

Merged
SaschaCowley merged 3 commits into
betafrom
sapi32language
Feb 5, 2026
Merged

Use translated strings for driver settings in 32 bit sapi synthDrivers#19562
SaschaCowley merged 3 commits into
betafrom
sapi32language

Conversation

@michaelDCurran

@michaelDCurran michaelDCurran commented Feb 5, 2026

Copy link
Copy Markdown
Member

Link to issue number:

Closes #19557

Summary of the issue:

When using 32 bit sapi synthDrivers introduced with pr #19432, particular strings, such as the display name of driver settings, when moving through the synth settings ring, are not translated into the current NVDA language.

Description of user facing changes:

The translations are now used, if available.

Description of developer facing changes:

Description of development approach:

  • Expose a getAppArg method on the NvDA service, which the synthDriverHost runtime can use to fetch a particular NvDA commandline argument value.
  • synthDriverHost runtime: Sync the language key from the general section of NVDA's configuration to the synthDriverHost's local copy of the configuration.
  • synthDriverHost: appropriately set its local copy of globalVars.appArgs.language to NVDA's value, using the NVDA Service's getAppArg method.
  • SynthDriverHost: set the language based on the language in the config / the overridden commandline argument value, using the same logic that NvDA uses in core.

Testing strategy:

  • Set NvDA's language to German. Select the sapi4 synthesizer. Move left and right through the synth settings ring, ensuring that parameters such as rate and pitched are correctly announced with their German translated names.
  • Do the above steps but instead of setting the configured language, override on the commandline with --lang de.

Known issues with pull request:

None known.

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.

…and set synthDriverHost's language accordingly, so that any exposed strings, such as driver settings for the synth settings ring, are correctly translated.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes a translation issue in the 32-bit SAPI synth drivers where driver setting names (like "rate" and "pitch") were not being translated into the user's configured NVDA language. The fix properly initializes the language handler in the synthDriverHost runtime using the same approach as NVDA core.

Changes:

  • Replaces the getLanguage method monkey-patch with proper language initialization via languageHandler.setLanguage()
  • Adds a getAppArg method to the NVDAService to retrieve commandline argument values
  • Synchronizes the language configuration key from NVDA to the synthDriverHost's local config
  • Initializes the language using the same logic as NVDA core (command line override takes precedence over config)

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
source/_bridge/clients/synthDriverHost32/launcher.py Adds getAppArg service method to expose NVDA commandline arguments to the runtime; removes deprecated getLanguage method
source/_bridge/runtimes/synthDriverHost/globalVars.py Adds language attribute initialization to appArgs
source/_bridge/runtimes/synthDriverHost/synthDriverHost.py Adds "language" to synchronized config values and properly initializes languageHandler using the same logic as NVDA core

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

Comment thread source/_bridge/runtimes/synthDriverHost/globalVars.py
Comment thread source/_bridge/clients/synthDriverHost32/launcher.py
Comment thread source/_bridge/clients/synthDriverHost32/launcher.py
@SaschaCowley SaschaCowley merged commit 0ea93e7 into beta Feb 5, 2026
39 checks passed
@SaschaCowley SaschaCowley deleted the sapi32language branch February 5, 2026 04:30
@github-actions github-actions Bot added this to the 2026.2 milestone Feb 5, 2026
@seanbudd seanbudd modified the milestones: 2026.2, 2026.1 Feb 6, 2026
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