phrase := "This is a test"
LangIn := "en"
LangOut := "de"
msgbox % GoogleTranslate(phrase,LangIn,LangOut)
GoogleTranslate(phrase,LangIn,LangOut)
{
base := "https://translate.google.com.tw/?hl=en&tab=wT#"
path := base . LangIn . "/" . LangOut . "/" . phrase
IE := ComObjCreate("InternetExplorer.Application")
;~ IE.Visible := true
IE.Navigate(path)
While IE.readyState!=4 || IE.document.readyState!="complete" || IE.busy
Sleep 50
Result := IE.document.all.result_box.innertext
IE.Quit
return Result
}
; For transliterations use:
Result := IE.document.getElementById("src-translit").innertext
or
Result := IE.document.all["src-translit"].innertext