Page tree
Skip to end of metadata
Go to start of metadata

The CTSX AT Language Solutions module performs translations using the AT Language Solutions APIs. Translations are handled synchronously or asynchronously.

Installation

Maven is the easiest way to install the module. Add the following dependency to your bundle:

<dependency>
    <groupId>info.magnolia.translation</groupId>
    <artifactId>magnolia-content-translation-support-ext-atls</artifactId>
    <version>${CTSExtendedVersion}</version>
</dependency>

Versions

3.3Magnolia 6.2.8 

In order to start the AT Language Solutions translation process, please make sure that the core and apps modules which mentioned in Content Translation Extended have already been installed.


Configuration

Configuration of the AT Language Solutions service provider is handled in the module config. This provider can be configured with the following properties.

Synchronous configuration

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 AT Language Solutions.

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

Asynchronous configuration

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.

/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.

Example:

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

    

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.

  • No labels