Table of Contents
A low-level client representing Amazon Translate:
import boto3
client = boto3.client('translate')
These are the available methods:
Check if an operation can be paginated.
Generate a presigned url given a client, its method, and arguments
The presigned url
Create a paginator for an operation.
Returns an object that can wait for some condition.
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.
To have Amazon Translate determine the source language of your text, you can specify auto in the SourceLanguageCode field. If you specify auto , Amazon Translate will call Amazon Comprehend to determine the source language.
See also: AWS API Documentation
Request Syntax
response = client.translate_text(
Text='string',
SourceLanguageCode='string',
TargetLanguageCode='string'
)
[REQUIRED]
The text to translate.
[REQUIRED]
One of the supported language codes for the source text. If the TargetLanguageCode is not "en", the SourceLanguageCode must be "en".
To have Amazon Translate determine the source language of your text, you can specify auto in the SourceLanguageCode field. If you specify auto , Amazon Translate will call Amazon Comprehend to determine the source language.
[REQUIRED]
One of the supported language codes for the target text. If the SourceLanguageCode is not "en", the TargetLanguageCode must be "en".
dict
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.
The available paginators are: