05-21-2018, 03:28 AM
Sometimes, I just want to open QM to help translate the selected paragraph, but the following code does not work, can you test it for me? thanks
In China, the URL https://translate.google.com cannot be used but only the URL https://translate.google.cn/
But I can't translate it after I changed com to cn
Function Translator
Trigger CF12
In China, the URL https://translate.google.com cannot be used but only the URL https://translate.google.cn/
But I can't translate it after I changed com to cn
Function Translator
Trigger CF12

;/
str selected_text.getsel
int h
GetWorkArea 0 0 0 h
int w=win
RECT r
scan F"color:{GetSysColor(COLOR_HIGHLIGHT)}" w r 2|16
int y=r.top+100
if y+100>h
,y=r.top-100
OnScreenDisplay "Wait a second..." 10 r.left y "" 12 0xff0000 1|4|16 "my-tooltip" 0xc0ffff
str translated_text=GoogleTranslator(selected_text "zh-CN")
OnScreenDisplay translated_text 0 r.left y "" 12 0xff0000 1|4|16 "my-tooltip" 0xc0ffff
err+ OnScreenDisplay "Error"