Page tree


If the API changes in an incompatible manner this is listed explicitly in the "important release notes" section of each releases changelog.

List the associations between tasks and language resources used for pivot pre-translation.

URL:

/editor/languageresourcetaskpivotassoc

Available Methods:

GET

Specialities:

List all available language resources for the given taskGuid (see get request resource layout)

Parameters:

taskGuid ( required) . If the taskGuid of a project is given, all available resources for all projectTasks will be listed.

The checked(see GET response layout) in the response shows if the language resource is assigned to the task.

Delete language resource - task association for pivot pre-translation

URL:

/editor/languageresourcetaskpivotassoc/[id]

Available Methods:

DELETE

Specialities:

Remove  task pivot association

Create language resource - task association for pivot pre-translation

URL:

/editor/languageresourcetaskpivotassoc

Available Methods:

POST

Specialities:

Create new language resource - task association for pivot pre-translation

Run or queue pivot pre-translation

URL:

/editor/languageresourcetaskpivotassoc/pretranslation/batch

Available Methods:

POST

Specialities:

Starts or queue pivot pre-translation operation for given task/project using all association created for this task/project. To run this operation on import, call the url after

the task is created (the files are submitted to the server) and before the import process is started.

Parameters:

taskGuid (required) . If taskGuid of a project is given, for all project tasks, the pre-translation 

operation will be started/queued

GET request resource Layout (list all available resources for a task/project)

{
    "rows": [
        {
            "taskName": "Task 1",
            "taskGuid": "{a50da61f-3ec3-48b0-aac5-5ac53f429c0b}",
            "languageResourceId": "11",
            "langResUuid": "049e59a6-4261-4b5f-8fbb-45b3a9c8dba6",
            "name": "Resource 1",
            "color": "19737d",
            "resourceId": "editor_Services_TermCollection",
            "serviceType": "editor_Services_TermCollection",
            "serviceName": "TermCollection",
            "specificData": "{\"term\":1183,\"status\":\"available\",\"fileName\":\"Term1.tbx\",\"attribute\":5275,\"termEntry\":443}",
            "timestamp": "2021-09-29 09:51:27",
            "resourceType": "termcollection",
            "writeSource": "0",
            "associd": null,
            "sourceLang": "5",
            "targetLang": "4",
            "checked": "false",
            "customerId": "143"
        },
        {
            "taskName": "Task 1",
            "taskGuid": "{a50da61f-3ec3-48b0-aac5-5ac53f429c0b}",
            "languageResourceId": "819",
            "langResUuid": "9069560a-378f-4453-89f3-4f071b341034",
            "name": "Resource 4",
            "color": "cdcdcd",
            "resourceId": "ZDemoMT",
            "serviceType": "editor_Plugins_ZDemoMT",
            "serviceName": "ZDemoMT",
            "specificData": "",
            "timestamp": "2022-06-23 15:41:20",
            "resourceType": "mt",
            "writeSource": "0",
            "associd": null,
            "sourceLang": "5",
            "targetLang": "4",
            "checked": "false",
            "customerId": "143"
        }
    ]
}

Post request example (assign resource to task)

{
	data:{
    	"languageResourceId":1,
	 	"taskGuid":"{341d3dab-8c0b-4469-a8a8-30e9ddb81a26}"
	}
}

The re is also an option to set language resources to be used as default for pivot pre-translation. Check the customerPivotAsDefaultIds parameter in this link LanguageResources: Instance

How pivot pre-translation is handled on translate5 UI or translate5 API import


Import using the translate5 Front-end

If a pivot language is selected and pivot language resources are assigned by default in the language resources management for the current combination of source language and pivot language for the current client:
Import with button "Import (use defaults):

  • For all file formats uploaded (normal source files, bilingual xliff files and zip import packages) a pivot column will column will be created and pre-translated with the language resources assigned for the pivot language. The same priorities are used, as for usual pre-translation (terminology in favor of TM in favor of MT).
  • If xliff files are uploaded as a pivot resource (either in the zip package or via the wizard) they are used as source of the pivot column and the pivot language resources are automatically unassigned.
  • Developers info: A pre-translation worker is queued always. The worker itself will run pivot pre-translation only if there are associations for the task.
    Import skip next steps
  • No pre-translation worker will be queued. And with this no pivot pre-translation is available.
  • The pivot column will be created, but will stay empty, if no bilingual files for pivot translation are provided
       The default associations are still assigned to the task, but will not be used for pre-translation so far. This can be done manually, if needed.

Import using translate5 API

All works the same way as if an import is triggered via the front-end with "Import (use defaults)" with one difference:
The pre-translation is not started automatically, but has to be started by an extra API call(see pretranslation/batch API call from above):

editor/languageresourcetaskpivotassoc/pretranslation/batch
and the taskGuid is required param

If you want to mimic the behavior of the front-end and start the pivot pre-translation automatically, you can use the following system configuration and set it to "true":
name: runtimeOptions.import.autoStartPivotTranslations
description: If set to active, for api created tasks the pivot worker will be queued automatically
quiName: Automatically queue pivot worker (API only)

  • No labels