Skip to main content

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 0 (Untranslated).

Specifies which segments will be machine translated:

0: Untranslated - Only translate segments that have no translation and cannot be pretranslated from memory. Recommended option as it only uses MT when memory pretranslation is not possible.

1: PreviousMachineTranslation - Only update segments that were previously machine translated.

2: All - All segments are candidates for MT (other filters may still apply).

int, Optional

ifTargetNotEmpty

Optional, default is true

true: Only translate if the target language does not already have a text

false: Always translate and replace existing target text

bool, Optional

skipGreen

When true, segments with green status (completed/approved) will be skipped and not machine translated. Set to false to include green segments.

Optional, default is true.

skipLocked

When true, locked segments will be skipped and not machine translated. Set to false to include locked segments.

Optional, default is true.

Example

CODE
{
  "scope": {
    "type": "Job",
    "jobid": "3044"
  },
  "doSave": true,
  "actions": {
    "items": [
      {
        "type": "MachineTranslate",
        "localeFrom": "en-US",
        "localeTo": "es-MX",
        "mtConnectorId": 1956,
        "toTranslate": 2,
        "skipGreen": true,
        "skipLocked": true
      }
    ]
  }
}

Full API Call Example

CODE
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,
        "skipGreen": false,
        "skipLocked": false
      }
    ]
  }
}'

Notes

  • The MT connector must be configured in the system before using this action

  • The mtConnectorId can be obtained from your system's MT connector configuration

  • This action respects the same scope and query filters as other batch actions

  • The response follows the standard batch action format with total, totalChanged, and totalFailedToSave properties

  • By default, both skipGreen and skipLocked are true, meaning green and locked segments are excluded from MT

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.