Open GoogleCodeExporter opened 9 years ago
I am facing the same problem. There is a similar unofficial API in python
(goslate), and I read that the Google Translate format changed slightly. They
have updated the code for it to work. Is it possible to do the same workaround
for this API? Thanks.
Original comment by taninam...@gmail.com
on 1 May 2015 at 4:43
Thanks for your help in stating python API as an alternative. But yes would had
been better if this existing API could be resolved.
Original comment by kapil2ka...@gmail.com
on 1 May 2015 at 4:24
:D faced the same issue. Now that is a major issue.
Original comment by shashaan...@gmail.com
on 2 May 2015 at 5:50
Ok found a solution, sharing with other.
There is a very minor fix required.
STEP1)
In class com.gtranslate.URLCONSTANT
change public static final String GOOGLE_TRANSLATE_TEXT =
"http://translate.google.com.br/translate_a/t?";
TO
public static final String GOOGLE_TRANSLATE_TEXT1 = "http://translate.google.com.br/translate_a/single?";
STEP2) In the class,
the appendURL function needs to be changed as shown
com.gtranslate.parsing.ParseTextTranslate
@Override
public void appendURL() {
Text input = textTranslate.getInput();
Text output = textTranslate.getOutput();
url = new StringBuilder(URLCONSTANTS.GOOGLE_TRANSLATE_TEXT);
/* url.append("client=t&text=" + input.getText().replace(" ", "%20"));
url.append("&hl=" + input.getLanguage());
url.append("&sl=" + input.getLanguage());
url.append("&tl=" + output.getLanguage());
url.append("&multires=1&prev=btn&ssel=0&tsel=0&sc=1"); */
url = new StringBuilder(URLCONSTANTS.GOOGLE_TRANSLATE_TEXT);
url.append("client=t&sl=auto&tl="+ output.getLanguage()
+"&hl=" + input.getLanguage()
+"&dt=bd&dt=ex&dt=ld&dt=md&dt=qc&dt=rw&dt=rm&dt=ss&dt=t&dt=at&ie=UTF-8&oe=UTF-8&otf=1&rom=1&ssel=0&tsel=3&kc=1&tk=620730|996163"
+ "&q=" + input.getText().replace(" ", "%20"));
}
Original comment by shashaan...@gmail.com
on 3 May 2015 at 10:23
[deleted comment]
How can we edit that code? Its not allowing me editing that file.
Original comment by AnmolYou...@gmail.com
on 3 May 2015 at 3:06
You may find the source code here in the below link create a jar file with
given changes :
http://java-google-translate-text-to-speech.googlecode.com/svn/
Original comment by kapil2ka...@gmail.com
on 3 May 2015 at 7:09
Superb :) it works. I have created a jar file with those changes, attached with
below.
Would be great if you can share the idea how did you come to know the fix and
some details about the fix will be greatly appreciated.
Original comment by kapil2ka...@gmail.com
on 3 May 2015 at 7:19
Attachments:
Thanks a lot. It worked. :)
Original comment by AnmolYou...@gmail.com
on 3 May 2015 at 7:25
Thanks a lot :).. it worked..
Original comment by iamthego...@gmail.com
on 14 May 2015 at 9:30
Would be great if the fix could be explained. :)
Original comment by kapil2ka...@gmail.com
on 14 May 2015 at 10:24
Shashaan, thank you very match!It worked!
Original comment by stan82s...@mail.ru
on 30 May 2015 at 1:09
Original issue reported on code.google.com by
kapil2ka...@gmail.com
on 17 Apr 2015 at 7:40