Having some trouble with my app which uses the paid version of google
translate. It works fine on several devices mostly (versions 2.2, 2.2.1, 2.3.5)
the lower versions but throws an exception in 4.0
Error: [google-api-translate-java] Error retrieving translation.
Here is my code
public String translate(String InputText, String from, String to) {
String key = ".........................";
String translatedText = null;
GoogleAPI.setHttpReferrer("http://android-er.blogspot.com/");
GoogleAPI.setKey(key);
Language fromLanguage = Language.valueOf(from);
Language toLanguage = Language.valueOf(to);
if (from.equals(to)) {
translatedText = InputText;
} else {
try {
translatedText = Translate.DEFAULT.execute(InputText,
fromLanguage, toLanguage);
} catch (GoogleAPIException e) {
// TODO Auto-generated catch block
e.printStackTrace();
translatedText = "Error";
}
}
return translatedText;
}
Note: I have tested the Google's Translate Application on all the devices and
it works fine
Original issue reported on code.google.com by transvox...@gmail.com on 11 Jul 2012 at 4:07
Original issue reported on code.google.com by
transvox...@gmail.com
on 11 Jul 2012 at 4:07