Hey!
First of all thanks for this API. I was using it a lot until Google decided to
block the first one.
Now, Im just trying to debug my old application and update it to work with
APIv2.
I enabled the billing from Google and got my API Key. I linked the new
libraries and did the follow changes to the code:
###################################
//API v1 Code
try
{
Translate.setHttpReferrer("http://www.google.com");
this.translatedText = Translate.execute(text, this.from, this.to);
} catch (Exception e) {
this.translatedText = ("Translation failed: " + e.getMessage());
}
###################################
//API v2 Code
try
{
GoogleAPI.setHttpReferrer("MyWebsite");
GoogleAPI.setKey("MyAPIkey");
this.translatedText = Translate.DEFAULT.execute(text, this.from, this.to);
} catch (Exception e) {
this.translatedText = ("Translation failed: " + e.getMessage());
}
###################################
After the first tests the output is:
"Translation failed: java.lang.Exception: [google-api-translate-java] Error
retrieving translation."
I tried to turn off any firewall software but the problem persists.
Any ideas?
Thanks in advance!
Original issue reported on code.google.com by leph...@gmail.com on 10 Dec 2011 at 2:20
Original issue reported on code.google.com by
leph...@gmail.com
on 10 Dec 2011 at 2:20