- Authors: Alexy Sadovoy, Beka Gozalishvili, Mesar Hameed, Alberto Buffolino and other NVDA contributors.
- Download stable version
- Download development version
This add-on is used to translate selected and/or clipboard text from one language to another. This is done using the Google Translate or the DeepL service, whichever you select.
To configure source, target and in case swap language, go to: NVDA Menu >> Preferences >> Instant Translate Settings.
There are two comboboxes labeled "Source language" and "Target language", and a checkbox to decide if it must copy the translation to clipboard.
In addition, if you selected auto option (the first choice) from "Source language" combobox, there are also a combobox labeled "Language for swapping" and a checkbox about the auto-swap.
The "Translation service" combobox selects the service that performs the translations, currently Google Translate or DeepL. The N command of the layer switches to the next one without opening the settings. Note that DeepL does not publish the list of languages it supports, so the built-in list is offered for it; asking it for a language it does not handle returns the text untranslated rather than an error.
Two checkboxes control what is announced: "Announce when a translation starts" tells you that a translation has been sent and that you have to wait for it, and "Beep while a translation is in progress" plays a short beep every second until it arrives.
The "Language pairs..." button opens a dialog where you can store up to ten source and target language pairs. Each pair is bound to a key of the Instant Translate layer, the first one to 1 and the tenth one to 0, so that pressing that key switches the source and target languages to that pair and translates the current selection with them. Use the Add, Edit and Remove buttons to manage the list, and Move up and Move down to change which key activates a pair.
The meaning of two first comboboxes and checkbox for copy is clear, but some words about the rest are necessary. Remember always that the explanations below assume the source language set on the auto option.
The "Language for swapping" combobox is useful when you swap via script (see below) the source and target language; in fact, a target language set on the auto option has no sense, so the addon sets it to value of combobox above.
So, imagine this situation: you usually translate into English (your main language), but sometimes (for example, when you write a document) you need to translate into Italian (your second language, suppose); you can set "Language for swapping" combobox to Italian, so you will translate from English to Italian without accessing directly to the addon settings. Obviously this function has a major or minor utility according to your more frequent needs.
Now, the auto-swap checkbox: it appears if and only if you set the auto option in "Source language" combobox, and is directly connected with "Language for swapping" combobox. If you activate it, then the addon tries to commute automatically from your source and target configuration to a configuration where target becomes the source language, and language selected in "Language for swapping" combobox is the new target language; extremely useful if the source language of the text you want translate is the target language.
A simple example: take again in mind the situation imagined previously; if you translate a text in a language different from English, there is no problem, you get the correct translation in English. But if you need to translate a text from English, normally you get a translation into English identical to original text, and this is a bit useless. Thanks to auto-swap function, however, assuming that you want to know how your text sounds into Italian, the addon commutes automatically the target language to Italian, so it returns a valid translation.
Anyway, this is a temporary configuration; if this option has no effect (it's experimental), try to commute manually to a stable configuration, using the gesture for swapping described below. It's experimental because in some situations (with short texts, typically), Google does not recognize the real source language correctly, and you have to swap languages manually via script, so to force the source language to be the previous target language (English in our example).
At least, in the speech settings parameters dialog (NVDA Menu >> Preferences >> Speech), you may want to check the "Automatic language switching (when supported)" option. This way, if you are using a multi-lingual synthesizer, the translation will be announced using the target language voice of the synthesizer.
You can use this add-on in four ways:
- Select some text using selection commands (shift with arrow keys, for example) and press associated key to translate. translation result will be read with synthesizer which you are using.
- You can also translate text from the Clipboard.
- Press the dedicated shortcut key to translate the last spoken text.
- Enable automatic translation to translate every speech output of NVDA
All following commands must be pressed after modifier key "NVDA+Shift+t":
- T: Translates the selected text,
- Shift+t: Translates the clipboard text,
- S: Swaps the source and target languages,
- 1 to 0: Switches to one of the configured language pairs,
- A: Announces the current source and target languages,
- C: Copies the last translation to the clipboard,
- I: Identifies the language of the selected text,
- L: Translates the last spoken text,
- V: Toggles automatic translation of speech output,
- X: Stops the translations in progress,
- P: Announces how far the translation in progress has got,
- R: Clears the cache of recent translations,
- O: Opens the Instant Translate settings dialog,
- N: Switches to the next translation service,
- H: Announces all available layer commands.
- Added DeepL as a translation service. The service can be chosen from settings.
- Switching to a language pair now triggers automatic translation.
- Added the N command to cycle through available translation services.
- Message announcing that a translation has started can now be turned off from settings.
- Fixed the formatting of the translated text.
- Rewrote the Google Translate provider. It uses newer endpoint the service exposes.
- languages offered for Google Translate are now fetched from the service itself.
- Added language pairs: up to 10 source and target combinations are managed from the settings and activated with the keys 1 to 0, which switch to the pair.
- Added the X command, stopping the translations in progress.
- Added the P command, announcing translation progress, in parts and as a percentage.
- Added the R command, clearing the cache of recent translations.
- The command list (H) is now presented in a browseable window, so the commands can be reviewed one by one instead of being spoken as a single long message.
- beeps played while a translation is in progress can be turned off from settings.
- Added a message announcing that a translation has started.
- Identifying the language of the selected text no longer freezes NVDA until the service answers.
- Updated to be compatible with python3.11 and nvda 2024.1
- Implemented speakOnDemand mode
- Fixed case with caching failled translations
- Added chinese mirror for translation
- Restore language detection and auto-swapping (Thanks to Cyrille for fix)
- updated languages for translation (thanks to Cyrille)
- Instant translate is now compatible with NVDA 2019.3 (Python 3 versions of NVDA)
- nvda compatibility fix Now instant translate will be compatible with latest nvda builds.
- found a way to use google as a translation service again.
- Restored working state with newer versions of nvda.
- Restored automatic language detection.
- InstantTranslate is working again, now with Yandex translator service instead of Google.
- Translation is automatically performed after swapping.
- Cache bug fixed.
- Change way how Shortcuts are used, now you can press instantTranslate modifier key "NVDA+Shift+t", and then single letter key to perform some action (see all Commands in the "Shortcuts" section).
- Implemented swapping languages.
- Changed configuration format, now we can change instant translate settings if we are in readonly pane, but remember that this will work before first restart of NVDA.
- Removed limit on amount of text that can be translated.
- Added shortcut t to the Instant Translate Settings menu item
- The auto option is now in first position in source combo, and absent in target combo.
- Added a checkbox for configuring copying translation results.
- Store config file in the root of settings folder.
- Source and target languages syncronized with what Google Translate currently exposes (22 Apr 2015).
- Now addon can translate text from clipboard when pressing nvda+shift+y.
- Added gui configurator where you can choose source and target languages.
- Added addon menu item found under preferences menu.
- Settings now is written in separate config file.
- Translation results now automatically copies into the clipboard for future manipulations.
- Initial version.