Amazon Translate

2017/11/29 - Amazon Translate - 1 new api methods

Changes  Public preview release of Amazon Translate and the Amazon Translate Developer Guide. For more information, see the Amazon Translate Developer Guide.

TranslateText (new) Link ΒΆ

Translates input text from the source language to the target language. You can translate between English (en) and one of the following languages, or between one of the following languages and English.

  • Arabic (ar)

  • Chinese (Simplified) (zh)

  • French (fr)

  • German (de)

  • Portuguese (pt)

  • Spanish (es)

See also: AWS API Documentation

Request Syntax

client.translate_text(
    Text='string',
    SourceLanguageCode='string',
    TargetLanguageCode='string'
)
type Text

string

param Text

[REQUIRED]

The text to translate.

type SourceLanguageCode

string

param SourceLanguageCode

[REQUIRED]

One of the supported language codes for the source text. If the TargetLanguageCode is not "en", the SourceLanguageCode must be "en".

type TargetLanguageCode

string

param TargetLanguageCode

[REQUIRED]

One of the supported language codes for the target text. If the SourceLanguageCode is not "en", the TargetLanguageCode must be "en".

rtype

dict

returns

Response Syntax

{
    'TranslatedText': 'string',
    'SourceLanguageCode': 'string',
    'TargetLanguageCode': 'string'
}

Response Structure

  • (dict) --

    • TranslatedText (string) --

      The text translated into the target language.

    • SourceLanguageCode (string) --

      The language code for the language of the input text.

    • TargetLanguageCode (string) --

      The language code for the language of the translated text.