This module helps you connect machine translation engines not yet supported by Crowdin. Once you create this kind of app, you’ll be able to pre-translate your content with the connected MT or enable translation suggestions made by it to be shown in the Editor for translators.
You can grant access to this module to one of the following user categories:
For Crowdin:
For Crowdin Enterprise:
{
"custom-mt": [
{
"key": "custom-mt",
"name": "Custom MT",
"logo": "/logo.png",
"url": "/translate",
"withContext": true,
"batchSize": 10
}
]
}
key | Type: Required: yes Description: Module identifier within the Crowdin app. |
name | Type: Required: yes Description: The human-readable name of the module. |
logo | Type: Required: yes Description: The relative URL to the custom MT's logo that will be displayed in the Crowdin UI. |
url | Type: Required: yes Description: The relative URL to the content page of the module that will be integrated with Crowdin. |
withContext | Type: Required: no Description: The additional meta data that will be sent along the strings. |
batchSize | Type: Required: no Description: The maximum quantity of strings that can be sent to the Custom MT app in one request. |
environments | Type: Allowed values: Description: Set of environments where a module could be installed. |
The system sends texts for translation using url
and then the app processes the texts and responds back to the system with one of the two possible types of responses: without errors, and with errors.
HTTP request:
https://{AppBaseUrl}/translate/?source=en&target=uk&project_id=727186
Request Headers
The request to translate
will contain authorization headers (e.g., Authorization: Bearer <App JWT token>
).
source | Type: Description: Source language. |
target | Type: Description: Target language. |
project_id | Type: Description: The numeric identifier of a Crowdin project. |
strings | Type: Description: Source strings that require translation. |
Request payload example:
{
"strings":[
"Save as...",
"New file",
"You received one message.",
"You received {number} messages."
]
}
To use the extended request please add the withContext
parameter to your Custom MT module.
Request payload example:
{
"strings":[
{
"id":1,
"projectId":727186,
"fileId":47047,
"text":"Save as...",
"identifier":"save_as",
"context":"translation Context",
"maxLength":15,
"isHidden":false,
"isPlural":false,
"pluralForm":null
},
{
"id":2,
"projectId":727186,
"fileId":47047,
"text":"New file",
"identifier":"new_file",
"context":"translation Context",
"maxLength":null,
"isHidden":false,
"isPlural":false,
"pluralForm":null
},
{
"id":3,
"projectId":727186,
"fileId":47047,
"text":"You received one new message.",
"identifier":"new_message",
"context":"translation Context",
"maxLength":null,
"isHidden":false,
"isPlural":true,
"pluralForm":"one"
},
{
"id":3,
"projectId":727186,
"fileId":47047,
"text":"You received {number} new messages.",
"identifier":"new_message",
"context":"translation Context",
"maxLength":null,
"isHidden":false,
"isPlural":true,
"pluralForm":"other"
}
]
}
Response payload example:
{
"data":{
"translations":[
"Зберегти як...",
"Новий файл",
"Ви отримали одне нове повідомлення.",
"Ви отримали {number} нових повідомлень."
]
}
}
Response payload example:
{
"error":{
"message":"Error message from the App or MT engine"
}
}
The structure of the responses from the app should correspond to the presented examples, otherwise Crowdin will consider them invalid.