Highlight Translator can help you to translate the words quickly and accurately. By only highlighting
, copying
, or screenshoting
the content you want to translate anywhere on your computer (ex. PDF
, PPT
, WORD
etc.), the translated results will then be automatically displayed before you.
Translation resource: Google Translate and Cambridge dictionary
OCR technology: Tesseract
Virtual Desktop Control DLL: Ciantic/VirtualDesktopAccessor Github
【2024/03/12】 Upgrade pyvda to 0.4.3
to fixed pyvda #34 Windows update KB5034765 completely broke pyvda
【2023/11/28】 Fixed the problem that Windows cannot be used after updating #12
Find the HighlightTranslator.exe
in the folder and then double click
- Highlight/Selected
- Screenshot (keyboard shortcut:
Windows + Shift + S
) - Copy
The window will be automatically appear when you copy
/highlight
/screenshot
some content and then automatically be hidden after a few seconds if you don't use it.
You can use it on the different virtual desktops without manually switching by yourself, it will automatically switch to the current virtual desktop
When the language of input texts is the same as the target language, the source language and target language will be automatically switched to each other.
It can speak the input sentences or the translated results and also can be automatic.
It will be helpful in learning languages
- Highlight/Selected (This method does not support Microsoft Office, but you can copy the words/sentences instead)
- Screenshot (Only English and Chinese supported currently, but feel free to add new languages by yourself)
Keyboard Shortcut:
Windows + Shift + S
- Copy
The window will automatically appear when you copy/highlight/screenshot some content and then automatically be hidden after a few seconds if you don't use it.
-
Cancel disappearance
If you don't want the window to automatically disappear, you can stop it by moving your mouse on the window or just clicking the checkbox on the top
-
Early Disappear
If you want the window to disappear early, you can move your mouse on the window first and then click anywhere out of the window
You can use it on different virtual desktops without manually switching by yourself, it will automatically switch to the current virtual desktop.
If the language of input texts is the same as the target language, the source language and target language will be automatically switched to each other.
It can speak the input sentences or the translated results, and also can be automatic.
Display InputBox and Translate Button.
You can type the text in InputBox and then press Enter
or click the Translate Button
to get the translation result.
If the checkbox is checked, the window will always be kept on top.
When you highlight some content, the translation will be automatically displayed.
You can set the config on the menu
Only Google and Cambridge Dictionary are supported for now. For Cambridge Dictionary, only "English to Chinese" supported
It can switch between source and target languages
This API can get the translation result from Google Translate
import GoogleTranslate as gt
print(gt.get_translate("good", "en","zh-TW"))
- inputtext: The text that you want to translate
- sourcelanguage: The language of the input text language
- targetlanguage: The language of the output result in language
You can refer to
language.txt
for all the languages supported.
- result: The most common result
- allresult: All of the results
- detect_language: Detecting the language of the input text
- revise: Suggestion when the text is seemingly misspelled
You can adjust these parameters in the Setting Interface.
{
"source_language":"Detect language",
"target_language":"Chinese (Traditional)",
"appear_time":6,
"dynamic_adjust_appear_time":1,
"auto_speak_length_limit":15,
"font":"Arial",
"font_size":11,
"audio_volume":0.95,
"number_of_terms":5,
"auto_switch_language":1,
"auto_change_dictionary":0,
"restructure_sentences":1,
"inputbox_color":"#F2D8B3",
"resultbox_color":"#FDF0C4",
"copycheck":0.3,
"doubleclickcheck":0.5,
"selectcheck":0.3
}
- source_language: Default source language
- target_language: Default target language
- appear_time: The window will automatically appear when you copy/highlight/screenshot some content and then automatically be hidden after a few seconds.
- dynamic_adjust_appear_time: The time of Window automatic appearance will be extended according to the length of input text(0 will close this feature if >0, every three words will extend
dynamic_adjust_appear_time
seconds) - auto_speak_length_limit: When the input length is less than the limit, the automatic speaking function will be triggered
- font
- font_size
- audio_volume: Speaking volume (0~1)
- auto_switch_language: Enable the source and target languages to be switched automatically (0 or 1)
- number_of_terms: Control the number of displayed translation results (terms) (>0)
- auto_change_dictionary: When the input is a word, the dictionary will be automatically switched to Cambridge dictionary (0 or 1)
- restructure_sentences: It will restructure your input sentences (0 or 1)
- inputbox_color: The background color of the input box
- resultbox_color: The background color of the result box
- copycheck: Check clipboard frequency (sec)
- doubleclick: the time between the two clicks that will make them viewed as a "doublecklick" (sec)
- select: The time of the press to make the press viewed as a "long press" (sec)
pip install -r requirements.txt
python Highlight_Translator.py
python 3.7
python==3.7
pyvda==0.4.3
pyinstaller==5.13.2
Pillow==9.5.0
pynput==1.6.0
PyAutoGUI==0.9.0
pytesseract==0.3.0
pywin32==306
requests>=2.24.0
beautifulsoup4>=4.9.3
numpy==1.21.6
pygame==2.5.2
gTTS==2.2.4