Downloading Tasks
Our API calls make it easy for LSPs to export the tasks assigned to them from our TMS and translate them in their own CAT tools. Your project and community settings in the TMS must allow for offline translation before you can use the APIs.
Use the following API calls to view and export your tasks.
- GET /task allows you to view the list of tasks assigned to you in the TMS.
- GET /task/{id}/content downloads the XLIFF for a given task.
Keep in mind the following as you are exporting tasks:
- Via the UI, a user is not able to download tasks (XLIFF files) that aren't in their Task List. Likewise, the API calls will need to authenticate using the credentials of the user to whom the task is assigned in Lingotek.
- You can only download XLIFF for 'Active' tasks (i.e. tasks that are ready to be worked on, but have not yet been 'marked complete' within Lingotek).
Editing XLIFF files
While you are editing the XLIFF files you should be aware of the following so that you can upload the files back into the TMS when you are finished editing:
- We follow XLIFF 1.2 specifications.
- Be sure not to modify the number of trans-units, their order or identifier.
- Adding style to the corrections is not advisable. For example, if a translation were to change from "dog" to "puppy", "puppy" should simply replace "dog" and not be something like "
dogpuppy." - Do not merge or split segments within your tool. If our system detects that one or more segments were merged or split, the re-import will fail.
Attributes and metadata
On export, we add a lgtk:phaseUUID attribute in the header of the XLIFF. This is what we match on when you re-import the XLIFF. Be sure that you do not remove this attribute.
Note |
---|
If the lgtk:phaseUUID attribute is missing, you will not be able to successfully re-import the XLIFF file. |
Lingotek doesn't import any meta from the uploaded XLIFF. All we do is extract the translations form the trans-units. We ignore everything else.
Tip | ||
---|---|---|
| ||
Modified dates for each segment translation will be set in our system based on the upload time. There is no need to add a modified date to a segment. |
phase-name: This provides clarification as to which phase this target is in. The export provides a number, which has a description in the <phase group> section in the <header>.
Tip | ||
---|---|---|
| ||
phase-name="1" might correspond to the following in the header: <phase phase-name="1" process-name="Translate"/> |
mrk: <mrk> is optional, but if present, there must only be one per target, and it must surround the entire segment. If there is more than one <mrk> segment in a <target>, the import fails. If there is one that does not completely encapsulate the segment, only the text within the <mrk> is imported.
Tip | ||
---|---|---|
| ||
Correct: <target...><mrk mtype="seg">This is my translation</mrk></target> Incorrect: <target...>This <mrk mtype="seg">text</mrk> is translated</target> (Will only import "text") Incorrect: <target...><mrk mtype="seg">This is one</mrk><mrk mtype="seg">too many mrk tags.</mrk></target> |
- mid: Optional. Used as an identifier for a specific <mrk> within the target.
- mtype: REQUIRED. This is required by the XLIFF 1.2 specification. It describes the type of mrk. The export uses "seg" as the mtype. If mtype is not present, the import will fail.
Uploading A Completed Task
Upon completing a Task outside of Lingotek's TMS, it is a simple process to push them back into the TMS. The following API calls will upload content into the TMS.
- PATCH /task/{id}/content.