vikasskool / google-api-translate-java

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

[400] invalid translation language pair #124

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
import com.google.api.translate.Language;
import com.google.api.translate.Translate;

public class Translation {
  public static void main(String[] args) throws Exception {

    Translate.setHttpReferrer("http://code.google.com/p/google-api-translate-java/");

    String translatedText = Translate.execute("Hello", Language.ENGLISH, Language.TAMIL);
    System.out.println(translatedText);
  }
}

What steps will reproduce the problem?
[NOTE: ENGLISH to HINDI,CHINESE...etc not getting this error]
1. Am getting the following while run this java file. this is only happened for 
TAMIL,TELUGU conversions.
2.
3.

What is the expected output? What do you see instead?
EXPECTED OUTPUT : 
[Tamil  word]

ERROR:
run:
Exception in thread "main" 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)
        at xlsxread.Tran.main(Tran.java:29)
Java Result: 1
BUILD SUCCESSFUL (total time: 2 seconds)

Please give a exact solution ASAP.
Thanks in advance.

Original issue reported on code.google.com by mariyapp...@gmail.com on 28 Jan 2011 at 3:51

GoogleCodeExporter commented 9 years ago
Saw the same issue today while working on a project. 

Original comment by fru.lo...@gmail.com on 12 Feb 2011 at 1:53

GoogleCodeExporter commented 9 years ago
It means the Google translation service doesn't support translating between the 
two languages.

You might like to try using an intermediate language, with all that that 
entails, but essentially this is a problem in the translation service, not this 
project which is just a Java wrapper for it.

Original comment by rich.mid...@gmail.com on 12 Feb 2011 at 10:23

GoogleCodeExporter commented 9 years ago
I have the same error of invalid language pair. The translator api works well 
with foreign languages like Russian, French, German etc. But the traditional  
Indian languages like Tamil, Telegu, Urdu, Bengali etc are not supporting the 
api.

Please help me with the solution.
Thanks.

Original comment by asif...@gmail.com on 21 Feb 2011 at 1:29

GoogleCodeExporter commented 9 years ago
I got the same issue. 

Original comment by krrakh...@gmail.com on 21 Mar 2011 at 11:05

GoogleCodeExporter commented 9 years ago
thats because google does not support that language . How ever 5 new languages 
are to be included recently i.e. urdu, georgian, armenian ,azerbaijani, basque. 
They have already been included in the google translate .But they are still 
unavailable in the google java api.

Original comment by devils.a...@gmail.com on 5 Apr 2011 at 9:14

GoogleCodeExporter commented 9 years ago
same error for ENGLISH TO URDU

Original comment by awaiswah...@gmail.com on 24 Jun 2011 at 9:57

GoogleCodeExporter commented 9 years ago
public class Translation {
  public static void main(String[] args) throws Exception {

    Translate.setHttpReferrer("http://code.google.com/p/google-api-translate-java/");

    String translatedText = Translate.execute("Hello", Language.ENGLISH, Language.TAMIL);
    System.out.println(translatedText);
  }
}

What steps will reproduce the problem?
[NOTE: ENGLISH to HINDI,CHINESE...etc not getting this error]
1. Am getting the following while run this java file. this is only happened for 
TAMIL,TELUGU conversions.
2.
3.

What is the expected output? What do you see instead?
EXPECTED OUTPUT : 
[Tamil  word]

ERROR:
run:
Exception in thread "main" 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)
        at xlsxread.Tran.main(Tran.java:29)
Java Result: 1
BUILD SUCCESSFUL (total time: 2 seconds)

can u please help me

Original comment by jaganbu...@gmail.com on 30 Jun 2011 at 12:14