Run Translation Program.ahk. A Messagebox will appear on every initial start. Just click ok to get rid of it. Now everytime you copy something a new Messagebox will apear with the translated text.
To close the program: First close all Messageboxes then press Control+j. This can be changed to whatever if you know your way around Autohotkey. Check Translate Program.ahk
Changing the language: Open Translate.ahk with any text edito of your choice and change "LangIn" and "LangOut" correspondingly. "LangIn" is the language of the original text and "LangOut" the language it is meant to be translated to.
You need to know the language codes. The Text is translated with Google Translator so expect some bad grammar and broken sentences, but for getting a basic understading of what is being said. Source: https://github.com/Pjer4/Translation-Program
Translation Program.ahk
^j:: Exitapp
Translate.ahk
SetTimer, WinMoveMsgBox, 50 |
MsgBox,4096, Translation, % GoogleTranslate(phrase,LangIn,LangOut) |
ID:=WinExist("Translation") |
ID:=WinExist("Translation") |
WinGetPos, Xc, Yc, Width, Height, ahk_id %ID% |
x=A_Screenwidth-WidthSetTimer, WinMoveMsgBox, OFF |
ID:=WinExist("Translation") |
WinMove, ahk_id %ID%, , %x%, 400 |
GoogleTranslate(phrase,LangIn,LangOut) |
base := "https://translate.google.com.tw/?hl=en&tab=wT#" |
path := base . LangIn . "/" . LangOut . "/" . phrase |
IE := ComObjCreate("InternetExplorer.Application") |
While IE.readyState!=4 || IE.document.readyState!="complete" || IE.busy |
Result := IE.document.all.result_box.innertext |
ExitApp |