Machine Translation
Machine Translation apps offer the possibility to use external machine translation providers within the Trados platform.
To build a new MT app we recommend starting by using the provided app blueprints.
Machine Translation Extension
An MT app needs to define at least one MT extension within its descriptor. For example:
{
...
"extensions": [
{
"id": "SAMPLE_MT_EXTENSION_ID",
"name": "SAMPLE_MT_EXTENSION_NAME",
"extensionPointVersion": "1",
"extensionPointId": "lc.mtprovider",
"description": "SAMPLE_MT_EXTENSION_DESCRIPTION",
"configuration": {
"endpoints": {
"lc.mtprovider.translate": "/v1/translate",
"lc.mtprovider.engines": "/v1/translation-engines"
},
"format": "html" // or "bcm"
}
}
]
...
}
id- unique extension identifier provided by the app Developername- provide a friendly and unique name. It might be shown to the end user, and it may be useful in helping the user distinguish between multiple extensionsextensionPointVersion- the version of the extension point that is implemented in the ExtensionextensionPointId- the extension point identifier corresponding to this extensionType: lc.mtproviderdescription- the MT extension descriptionconfiguration- the extension configurationendpoints- the required endpoints for the MT extensionlc.mtprovider.translate- the endpoint used to receive and translate content from Tradoslc.mtprovider.engines- the endpoint used to retrieve the available translation engines (supported language pairs)
format- the content's format supported by the app on thetranslateendpoint.
Translation Engines Endpoint
The lc.mtprovider.engines endpoint provides the available translation engines for the requested language pairs.
Example:
GET /v1/translation-engines?model=NEURAL&sourceLanguage=en-US&targetLanguage=ro-RO&targetLanguage=ro-MD&targetLanguage=fr-FR&exactMatch=true
The
modelis the translation engine's type and its value can be eitherNEURALorBASELINE.The
exactMatchwill enforce the result to include only the languages that match the exact values of the requested languages.There could be multiple target languages requested, thus the endpoint should return all translation engines for the supported ones.
The response would look like this:
{
"items": [
{
"id": "en_fr_nmt",
"model": "nmt",
"name": "nmt",
"engineSourceLanguage": "en",
"engineTargetLanguage": "fr",
"matchingSourceLanguage": "en-US",
"matchingTargetLanguages": [
"fr-FR"
]
},
{
"id": "en_ro_nmt",
"model": "nmt",
"name": "nmt",
"engineSourceLanguage": "en",
"engineTargetLanguage": "ro",
"matchingSourceLanguage": "en-US",
"matchingTargetLanguages": [
"ro-RO",
"ro-MD"
]
}
],
"itemCount": 2
}
nmtstands for "NEURAL MACHINE TRANSLATION"
Endpoint usage
This endpoint is going to be used when creating a new Translation Engine resource as shown below:

The Machine Translation models are provided by the app via the lc.mtprovider.engines endpoint.
The blueprints contain placeholders from where you can start implementing the endpoint's functionality:
Please refer to the endpoint's documentation for further details.
Translate Endpoint
The lc.mtprovider.translate endpoint translates the content, namely the text provided in the format specified in the descriptor (html of bcm).
Example:
POST /v1/translate
{
"contents": [
"<div i=\"24\">Here’a a smiley face <img i=\"25\"/></div>",
"<div i=\"10\">Here’s a table:</div>"
],
"engineId": "en_ro_nmt"
}
The
engineIdis the identifier of the engine used to translate thecontents.The response would look like this:
{
"translations": [
"<div i=\"24\"> Iată un chip zâmbet <img i=\"25\"/></div>",
"<div i=\"10\"> Iată un tabel: </div>"
]
}
<div i="1"> .. </div>might cause problems for some engines. You can parse them out before sending them to the translation service if the order of the segments can be guaranteed. Once the translated segments are available, these need to be added back when sending the response.
Endpoint usage
To test the endpoint, first, you will need a workflow that contains the Machine Translation automatic task and the Translation human task. For example:

Using that workflow and the translation engine created in the previous step, you can start a new project like this:

When the project reaches Translation, you can open it in the Online Editor and check the target segments. This is where you should find the translations performed by your app in the Machine Translation step. You can also search for Lookups to obtain alternative translations. This will invoke again the lc.mtprovider.translate endpoint.

You can find more details on how to use an MT app in the consumer guide.
The blueprints contain placeholders from where you can start implementing the endpoint's functionality:
Please refer to the endpoint's documentation for further details.