I want to translate the specified text into multiple target languages similar to what Microsoft Translator API supports. I can do this in AWS SDK AmazonTranslateClient.TranslateTextAsync by calling it in a loop but that causes multiple HTTP calls for each target language. And it's very slow because of the loop.

I want to pass source text, the source language, and multiple target languages and get an array of a translated text back for each target language in 1 API call. I can do this easily in Microsoft Translator API without using any explicit storage and it translates at runtime.

How can I do similar in Amazon Translate? StartTextTranslationJobRequest requires an S3 account to be configured for input and output. I don't want to store any text, just do translation at runtime and return the result.

For eg.

SourceText=Hello World, SourceLanguage=en, TargetLanguages=de,it,ja,th

And output something like this...

enter image description here

1

There are 1 best solutions below

0
On

The real-time API (TranslateText) supports only one output language: https://docs.aws.amazon.com/translate/latest/dg/API_TranslateText.html

The batch API (StartTextTranslationJob) parameters hints at multiple outputs (see the TargetLanguageCodes parameter), but it's not supported yet: https://docs.aws.amazon.com/translate/latest/dg/API_StartTextTranslationJob.html. I suppose this will come later!