Page tree

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Description

Instant-translate is translate5 api interface which can be used for translating text and files using the translate5 language resources (term collections, translation memories or machine translation engines).

Available language resource for instant translate are the assigned resources of a customers of the current logged-in user.

For translating files, the file-extension must be configured accordingly.

Translate text with translate5 language resources .

URL:

/editor/instanttranslateapi

Available Methods:

GET

Specialities:

To be able to search for a text, there must be available language resources assigned to a customers of a user

Availability:

-

Translate text resource Layout

Name

Type

Info

text

string

The string to translate.

source

string

The source language to translate from. Must be valid rfc5646 code.

targetstringThe target language to translate to. Must be valid rfc5646 code.

Translate file with translate5 language resources .

URL:

/editor/instanttranslateapi/file

Available Methods:

POST

Specialities:

Translate complete file from one language to another.

Availability:

Currently this option is only available with SdlLanguage Cloud service. To be able to use the sdl cloud resource, and valid api key and api url need to be configured.

Mandatory configurations (Zf_configuration table):

  • runtimeOptions.LanguageResources.sdllanguagecloud.server
  • runtimeOptions.LanguageResources.sdllanguagecloud.apiKey


Translate file resource Layout

Name

Type

Info

file

multipart/form-data

The string to translate.

source

string

The source language to translate from. Must be valid rfc5646 code. When no domainCode is provided this is mandatory.

targetstringThe target language to translate to. Must be valid rfc5646 code. When no domanCode is provided this is mandatory.
domainCodestringUnique sdl language cloud engine id(domainCode).

Response layout:

{

"fileId":"5bc89c96a901be0001cca190"

}

  • the fileId is unique file id used to get the file download url

Get translation file url

URL:

/editor/instanttranslateapi/url

Available Methods:

GET

Specialities:

Get the download url for the translation file

Availability:

-


Get translate file resource Layout

Name

Type

Info

fileIdstringUnique id of the file for translation.

Response layout:

{

"downloadUrl":"https://www.lc-api.sdl.com/file-translations/5bc89c96a901be0001cca190/translated-file"

}

  • use the url to download the file

Configuration of InstantTranslate

runtimeOptions.LanguageResources.searchCharacterLimitmap
Maximum character per language resource allowed for search. The configuration key is the language resource id, and the value is the character limit. Ex: {{"1": 100},{"2": 300}}
  • No labels