Translate
|
|||||
|
|
||||
Translates input text, returning translated text
Authorization
To use this building block you will have to grant access to at least one of the following scopes:
- Translate text from one language to another using Google Translate
- View and manage your data across Google Cloud Platform services
Input
This building block consumes 5 input parameters
| Name | Format | Description |
|---|---|---|
target |
STRING |
The language to use for translation of the input text, set to one of the language codes listed in Language Support |
q[] |
STRING |
|
format |
STRING |
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 |
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 |
model |
STRING |
The |
= Parameter name
= Format
|
target STRING The language to use for translation of the input text, set to one of the language codes listed in Language Support |
|
q[] STRING |
|
format STRING 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 |
|
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 |
|
model STRING The |
Output
This building block provides 5 output parameters
| Name | Format | Description |
|---|---|---|
data |
OBJECT |
The main language translation response message |
data.translations[] |
OBJECT |
|
data.translations[].detectedSourceLanguage |
STRING |
The source language of the initial request, detected automatically, if no source language was passed within the initial request. If the source language was passed, auto-detection of the language will not occur and this field will be empty |
data.translations[].model |
STRING |
The |
data.translations[].translatedText |
STRING |
Text translated into the target language |
= Parameter name
= Format
|
data OBJECT The main language translation response message |
|
data.translations[] OBJECT |
|
data.translations[].detectedSourceLanguage STRING The source language of the initial request, detected automatically, if no source language was passed within the initial request. If the source language was passed, auto-detection of the language will not occur and this field will be empty |
|
data.translations[].model STRING The |
|
data.translations[].translatedText STRING Text translated into the target language |