abdalnassef / google-api-translate-java

Automatically exported from code.google.com/p/google-api-translate-java
0 stars 0 forks source link

English to Tamil and vice versa reports exception #130

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
It must be an invalid language pair I guess.

Perhaps try an intermediary.

Original comment by rich.mid...@gmail.com on 17 Feb 2011 at 6:53