Skip to content

Comments

Fix compatibility with 2026.1#44

Open
CyrilleB79 wants to merge 2 commits intoaddonFactory:masterfrom
CyrilleB79:prep2026.1
Open

Fix compatibility with 2026.1#44
CyrilleB79 wants to merge 2 commits intoaddonFactory:masterfrom
CyrilleB79:prep2026.1

Conversation

@CyrilleB79
Copy link

@CyrilleB79 CyrilleB79 commented Feb 5, 2026

Issue

When trying to override compatibility with NVDA 2026.1beta1, an error occurs at startup and the add-on cannot load.
This is due to the fact thatversion_year has been moved in 2026.1.

Once this first issue fixed, the following deprecation warning occurs:
DEBUGWARNING - Python warning (22:07:38.937) - MainThread (8924):
C:\Users\cyril\AppData\Roaming\nvda\addons\instantTranslate\globalPlugins\instantTranslate_init_.py:53: ```
DeprecationWarning: 'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15. Use setlocale(), getencoding() and getlocale() instead.
lo_lang = getdefaultlocale()


### Solution
* Rather than checking NVDA version, directly try to import `speech.speech` and else only import `speech`.
* Regarding the deprecation: use `getlocale()` as recommended.
### Tests
Tested translation, automatic translation and translation of last spoken text.

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.

1 participant