Closed GoogleCodeExporter closed 8 years ago
Thanks Mike, I think the use case you mention should be covered by this method,
which
should also exist:
public static String[] execute(final String text, final Language from, final
Language[] to) throws Exception;
http://code.google.com/p/google-api-translate-
java/source/browse/trunk/src/com/google/api/translate/Translate.java#106
Marking as done for now. Thanks.
Original comment by rich.mid...@gmail.com
on 2 Nov 2009 at 9:00
public static String[] execute(final String text, final Language from, final
Language[] to) throws Exception;
would handle the first use case
execute("Hello", Language.ENGLISH, Language[] {Language.SPANISH,
Language.FRENCH, Language.GERMAN})
But I don't see a method that would handle the second use case
execute(new String(){} {"Hello", "Goodbye"}, Language.ENGLISH, Language[]
{Language.SPANISH})
I'm not saying the API should necessarily support the second use case, I just
wanted
to point out that it doesn't. And if I were to update to the trunk version I
would
need to write support for that method myself because I prefer to use the one
call
over many calls.
Thanks Rich.
Original comment by mikenere...@gmail.com
on 2 Nov 2009 at 9:38
Ah, sorry, I missed the second one somehow!
I agree that API call is missing. I'll have a think about it, I'm not sure I'll
add
it at the moment as the returned Array of Strings wouldn't necessarily be in an
intuitive order if more than one target Language is supplied. Should still be
possible to make one API call using the one which takes an Array for each
parameter.
I've been trying to avoid returning a more complex object than a String[], at
least
without more thought than I've yet given it, but perhaps this is another case
for
that. Thanks.
Original comment by rich.mid...@gmail.com
on 2 Nov 2009 at 10:22
I like that they all return String[]. You could return String[]{Phrase1Lang1,
Phrase1Lang2, Phrase2Lang1, Phrase2Lang2, etc}
Original comment by mikenere...@gmail.com
on 2 Nov 2009 at 10:32
Original issue reported on code.google.com by
mikenere...@gmail.com
on 30 Oct 2009 at 1:47