Machine Translate Action
Overview
This action permits to machine translate texts using a configured MT connector.
The action is configured as follows:
Parameters
Property | Description | Type |
|---|---|---|
type | "MachineTranslate" | string, Mandatory |
localeFrom | The source language of the segments to translate. | string, Mandatory |
localeTo | The target language into which the MT will write translations. | string, Mandatory |
mtConnectorId | The ID of the MT connector to use for translation. This refers to a pre-configured machine translation connector in the system. | int, Mandatory |
toTranslate | Optional, default is Specifies which segments will be machine translated:
| int, Optional |
ifTargetNotEmpty | Optional, default is true
| bool, Optional |
Example
{
"scope": {
"type": "Job",
"jobid": "3044"
},
"doSave": true,
"actions": {
"items": [
{
"type": "MachineTranslate",
"localeFrom": "en-US",
"localeTo": "es-MX",
"mtConnectorId": 1956,
"toTranslate": 2
}
]
}
}
Full API Call Example
curl --location 'https://WM-22034.wordbee-translator.com/api/resources/segments/view/actions/batch' \
--header 'X-Auth-Token: ***' \
--header 'X-Auth-AccountId: wordbee.test' \
--header 'Content-Type: application/json' \
--data '{
"scope": {
"type": "Job",
"jobid": "3044"
},
"doSave": true,
"actions": {
"items": [
{
"type": "MachineTranslate",
"localeFrom": "en-US",
"localeTo": "es-MX",
"mtConnectorId": 1956,
"toTranslate": 2
}
]
}
}'
Notes
The MT connector must be configured in the system before using this action
The
mtConnectorIdcan be obtained from your system's MT connector configurationThis action respects the same scope and query filters as other batch actions
The response follows the standard batch action format with
total,totalChanged, andtotalFailedToSaveproperties