Translates input text, returning translated text.
Arguments
format
enum
The format of the source text, in either HTML (default) or plain-text. A value of "html" indicates HTML and a value of "text" indicates plain-text.
key
string
A valid API key to handle requests for this API. If you are using OAuth 2.0 service account credentials (recommended), do not supply this parameter.
model
string
The model
type requested for this translation. Valid values are listed in public documentation.
q
string
Required. The input text to translate. Repeat this parameter to perform translation operations on multiple text inputs.
source
string
The language of the source text, set to one of the language codes listed in Language Support. If the source language is not specified, the API will attempt to identify the source language automatically and return it within the response.
target
string
Required. The language to use for translation of the input text, set to one of the language codes listed in Language Support.
Raised exceptions
ConnectionError
HttpError
TimeoutError
TypeError
ValueError
Response
If successful, the response contains an instance of TranslationsListResponse
.
Subworkflow snippet
Some fields might be optional or required. To identify required fields, refer to the API documentation .
YAML
- translate : call : googleapis.translate.v2.translations.translate args : format : ... key : ... model : ... q : ... source : ... target : ... result : translateResult
JSON
[ { "translate" : { "call" : "googleapis.translate.v2.translations.translate" , "args" : { "format" : "..." , "key" : "..." , "model" : "..." , "q" : "..." , "source" : "..." , "target" : "..." }, "result" : "translateResult" } } ]

