CTSX AT Language Solutions
Content management Incubator
Issues |
|||
Git |
|||
Latest |
3.4.14
|
The CTSX AT Language Solutions module performs translations using the AT Language Solutions APIs. Translations are handled synchronously or asynchronously.
Installing with Maven
Maven is the easiest way to install the module. Add the following to your bundle:
In order to start the ATLS translation process, please make sure that the core and apps modules in the Content Translation Extended have already been installed. |
<dependency>
<groupId>info.magnolia.translation</groupId>
<artifactId>magnolia-content-translation-support-ext-atls</artifactId>
<version>3.4.14</version>
</dependency>
Configuration
Configuration of the ATLS service provider is handled in the module config. This provider can be configured with the following properties.
Property | Description |
---|---|
|
required Definition class for the translator to be used. See |
|
required The display name of the configuration in Magnolia. |
|
optional The default configuration used by the system in the case of multiple translation services being used. |
|
required Enable or disable the configuration using this flag. |
|
required Implementation class for interfacing with ATLS. See |
Property | Description |
---|---|
|
required Definition class for the translator to be used. See info.magnolia.translation.ext.provider.definition.AtlsAsynchronousProviderDefinition |
|
required The display name of the configuration in Magnolia. |
|
optional The default configuration used by the system in the case of multiple translation services being used. |
|
required Enable or disable the configuration using this flag. |
|
required Implementation class for interfacing with AT Language Solutions. See |
YAML configuration
The AT Language Solutions module is integrated using the REST Client module. The configuration in YAML is.
Expand to see sample
baseUrl: https://services.at-translationservices.com
restCalls:
ping:
method: GET
entityClass: com.fasterxml.jackson.databind.JsonNode
path: /atrts/restapi/ping
synchronous:
method: POST
entityClass: com.fasterxml.jackson.databind.JsonNode
path: /atrts/restapi/translateSynchronous
body: '{"sourcelang": "{sourcelang}", "filename": "{filename}", "targetlang": "{targetlang}", "base64": "{base64}"}'
headers:
X-ATRTS-API-Key: "-- API KEY FROM ATLS --"
Host: "services.at-translationservices.com"
Content-Type: "application/x-www-form-urlencoded"
asynchronous:
method: POST
entityClass: com.fasterxml.jackson.databind.JsonNode
path: /atrts/restapi/translateAsynchronous
body: '{"sourcelang": "{sourcelang}", "filename": "{filename}", "targetlang": "{targetlang}", "base64": "{base64}"}'
headers:
X-ATRTS-API-Key: "-- API KEY FROM ATLS --"
Host: "services.at-translationservices.com"
Content-Type: "application/x-www-form-urlencoded"
fileByToken:
method: POST
entityClass: com.fasterxml.jackson.databind.JsonNode
path: /atrts/restapi/getFileByToken
body: '{"token": "{token}"}'
headers:
X-ATRTS-API-Key: "-- API KEY FROM ATLS --"
Host: "services.at-translationservices.com"
Content-Type: "application/x-www-form-urlencoded"
It’s necessary to decorate the "magnolia-content-translation-support-ext-atls" to add the value "X-ATRTS-API-Key" provided by AT Language Solutions. |
Expand to see sample
restCalls:
synchronous:
headers:
X-ATRTS-API-Key: "978cd5fa-1e82-xxxx-adc1-0242ac120002"
asynchronous:
headers:
X-ATRTS-API-Key: "978cd5fa-1e82-xxxx-adc1-0242ac120002"
fileByToken:
headers:
X-ATRTS-API-Key: "978cd5fa-1e82-xxxx-adc1-0242ac120002"
Usage
After registration and starting, The Content Translation Support Extended (CTSX) module will bind the AT Language Solutions translator, to Configuration field.
You can test the connection to the translator API before using. |
![atls](_images/atls.jpg)
How it works
The same steps with CTSX Google Translator but you will choose "Sync Atls Translate" or "Async Atls Translate" instead of "Google.com" in the Configuration depending on whether you want a synchronous or asynchronous translation.
In addition, if you have chosen an asynchronous translation, at "Step 2" after submitting the batch you must wait for the response from AT Language Solutions translator. |
You would be able to see the Task notification for translation result as soon as the submission has been delivered.