andreask7 / lwt

Learning with Texts (LWT) is a tool for Language Learning. The official version (not this one) is available at :
http://lwt.sf.net
Other
33 stars 7 forks source link

No results from Google Translator API #5

Closed ducedo closed 9 years ago

ducedo commented 9 years ago

Noticed yesterday that ggl.php suddenly stopped returning results. Tried updating to the latest version of the file but it's the same problem. Thought it was be a temporary problem or a limit but I've got the same issue on my other IP. The 'regular' popup works though without problem.

andreask7 commented 9 years ago

Hello,

the google translate API I used redirects to a captcha now and therefore doesn't work anymore. You can try it out by entering the following URI into your browser: http://translate.google.com/translate_a/t?client=t&text=test&hl=en&sl=de&tl=en&ie=UTF-8&oe=UTF-8&multires=1&otf=1&pc=1&trs=1&ssel=3&tsel=6&sc=1

I found another API, but I still have to make some tests before I release a new version.

You can try it out if you replace line 23 in ggl.php:

private static $urlFormat = "http://translate.google.com/translate_a/t?client=t&text=%s&hl=en&sl=%s&tl=%s&ie=UTF-8&oe=UTF-8&multires=1&otf=1&pc=1&trs=1&ssel=3&tsel=6&sc=1";

by:

private static $urlFormat = "http://translate.google.com/translate_a/single?client=t&q=%s&hl=en&sl=%s&tl=%s&dt=bd&dt=ex&dt=ld&dt=md&dt=qc&dt=rw&dt=rm&dt=ss&dt=t&dt=at&dt=sw&ie=UTF-8&oe=UTF-8&oc=1&otf=2&ssel=0&tsel=3";

Andreas

ducedo commented 9 years ago

Thanks. It solved the problem.