Closed GoogleCodeExporter closed 8 years ago
The attached file provide support for V2 of the Google translate APIs.
And the attached jar file is a 0.96-SNAPSHOT with that file added.
Original comment by william....@gmail.com
on 27 Oct 2011 at 10:27
Attachments:
Does this require another jar, Im now getting:
Exception in thread "Thread-6" java.lang.NoClassDefFoundError:
org/json/JSONObject
at com.google.api.GoogleAPI.retrieveJSON(GoogleAPI.java:127)
at com.google.api.translate.Translate.execute(Translate.java:69)
at prman.model.trans.GoogleTranslator$GoogleTranslationEngine.search(GoogleTranslator.java:115)
at prman.model.trans.AbstractTranslation.run(AbstractTranslation.java:54)
Original comment by paultay...@jthink.net
on 31 Oct 2011 at 4:56
As Rich outlined at http://code.google.com/p/google-api-translate-java/ the
JSON implementation has been split out of the project. So you will need to
include that.
Original comment by william....@gmail.com
on 31 Oct 2011 at 8:43
Thx, didnt notice that I think its also worth pointing out you need to change
your code to use TranslateV2 rather than Translate it wont just start working
magically.
Now working.
Original comment by paultay...@jthink.net
on 1 Nov 2011 at 12:29
can someone tell me what are the differences in implementation in the code
between v1 and v2 Apis?
especially for use in jsp, following the example of the following url, which I
have the api v1. I read that only need to add before running, the NEXT line,
-GoogleAPI.setKey ("api_key");
http://code.google.com/p/google-api-translate-java/
I can help change or add what is needed to use the api v2
Original comment by luis....@gmail.com
on 4 Nov 2011 at 5:17
You need to
1) Use TranslateV2 instead of Translate
2) You need to set an API key.
The only thing that is needed is for someone to commit my patch above.
Original comment by william....@gmail.com
on 5 Nov 2011 at 3:13
Thanks for the patch William. Should be in version 0.97 if I haven't made any
omissions.
An instance of TranslateV2 is available from Translate.DEFAULT now.
Original comment by rich.mid...@gmail.com
on 5 Nov 2011 at 5:13
Original issue reported on code.google.com by
mils...@gmail.com
on 17 Oct 2011 at 1:15