When I executed the following program(below) it reports:
java.lang.Exception: Google returned the following error: [400] invalid
translation language pair
at com.google.api.translate.Translate.getJSONResponse(Translate.java:182)
at com.google.api.translate.Translate.execute(Translate.java:71)
how to overcome it?
import com.google.api.translate.Language;
import com.google.api.translate.Translate;
public class Main {
public static void main(String[] args) throws Exception {
// Set the HTTP referrer to your website address.
Translate.setHttpReferrer("www.google.com");
String translatedText = Translate.execute("tree",
Language.ENGLISH,Language.HINDI);
System.out.println(translatedText);
}
}
Original issue reported on code.google.com by rvivekan...@gmail.com on 17 Feb 2011 at 12:01
Original issue reported on code.google.com by
rvivekan...@gmail.com
on 17 Feb 2011 at 12:01