microsoft-translator-java-api icon indicating copy to clipboard operation
microsoft-translator-java-api copied to clipboard

Translate a single String to various different languages

Open durgapraveen opened this issue 14 years ago • 1 comments

can we get the different languages from a same string in a single method by using string array?

durgapraveen avatar Jun 10 '11 09:06 durgapraveen

Hello, thanks for the request.

The short answer is that the Microsoft Translator v2 TranslateArray service does not permit either multiple origin languages or multiple target languages for each text in the array. All texts are assumed be of the same origin language and may only be translated to one target language.

While it would be possible to provide a convenience method to perform such translations (and searching for efficiencies by bundling same origin / target languages), behind the scenes the API would be making multiple calls to the service and, in essence, just providing a batching abstraction for a serial process.

It would be possible for you to do the same thing with the API today, only managing that process in your own application.

Please see the discussion at https://github.com/boatmeme/microsoft-translator-java-api/issues/5

I'll leave this as an open issue as I may bake this behavior into the API in a future release, but it is unlikely to get done for a while.

boatmeme avatar Jun 10 '11 13:06 boatmeme