Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This method translates files using submits one or more files for translation using the MT Hive service.

Please note that the file or files need to be uploaded first. Only then would you call the present method. See below for details. 

URL

(POST) /api/apps/mthive/translate/files

...

files

Mandatory. A list of the previously uploaded files that you submit for translation.

Each file is listed with its file token and the file format ID to use.

Example:

Code Block
[
  {
    "token": "3e896bb7812d48e780a119adf39c6dd0",
    "parserId": 1235
  },
  {
    "token": "3e896bb7812d48e780a119adf39c6dd0",
    "parserId": 231
  }
]

See below on how to upload files and obtain the file tokens.

object[], Mandatory
src

The source language code. Make sure to only use source languages according to the MTHive configuration.

string, Mandatory
trgMandatory. The target language code. Make sure to only use target languages according to the MT Hive configuration.string, Mandatory
profileOptionIdx

The option index for the selected Mt Hive configuration (Zero-based index).

MT Hive lets you specify multiple profiles, see "Settings" > "MT Hive" (see Administration of MT Hive)

int, Mandatory

FILES AND CONFIGURATIONS

...

The parserId field designates the file filter configuration to use to process the file. You find the available options for each type of file in the configuration under node /options/{option index}/formats/{file type}/foptions[*]/foption

Example:

Image RemovedImage Added

Here a single option (2266) is available for Microsoft Word files. Since the configuration lists the supported file extensions, it is relatively easy to automate a lookup mechanism in code.

 Using Note that multiple options may be available for a specific type of file. In such a case, MT Hive should propose both options to the user and preselect the first option by default.

Using an ID that does not exist will result in a failure.

...