Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Embed Google Translate Website, Prompt Website Security Issue
#5
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     Help - how to add the trigger to the macro
Code:
Copy      Help
;/
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"


Messages In This Thread
RE: Embed Google Translate Website, Prompt Website Security Issue - by win - 05-21-2018, 03:28 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)