CTSX AT Language Solutions

Content management Unbundled: Extension

Issues

Git

Git

Latest

3.4.14

Compatible with Magnolia 6.2.

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.

Table 1. Synchronous
Property Description

class

required

Definition class for the translator to be used.

See info.magnolia.translation.ext.provider.definition.AtlsSynchronousProviderDefinition.

configName

required

The display name of the configuration in Magnolia.

defaultFlag

optional

The default configuration used by the system in the case of multiple translation services being used.

enabledFlag

required

Enable or disable the configuration using this flag.

implementationClass

required

Implementation class for interfacing with ATLS.

See info.magnolia.translation.ext.provider.google.translator.AtlsSynchronousTranslator.

Table 2. Asynchronous
Property Description

class

required

Definition class for the translator to be used.

See info.magnolia.translation.ext.provider.definition.AtlsAsynchronousProviderDefinition

configName

required

The display name of the configuration in Magnolia.

defaultFlag

optional

The default configuration used by the system in the case of multiple translation services being used.

enabledFlag

required

Enable or disable the configuration using this flag.

implementationClass

required

Implementation class for interfacing with AT Language Solutions.

See info.magnolia.translation.ext.atls.translator.AtlsAsynchronousTranslator.

YAML configuration

The AT Language Solutions module is integrated using the REST Client module. The configuration in YAML is.

Expand to see sample

/magnolia-content-translation-support-ext-atls/restClients/atls.yaml
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

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.

Feedback

DX Core

×

Location

This widget lets you know where you are on the docs site.

You are currently perusing through the Content Translation Extended module docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules