CTSX Microsoft Translator

Content management Incubator

Issues

Git

Git

Latest

3.5.3

Compatible with Magnolia 6.2.

The CTSX Microsoft module performs translation via Microsoft.

Installing with Maven

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

In order to start the Microsoft 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-microsoft</artifactId>
  <version>3.5.3</version>
</dependency>

Configuration

The configuration can be done using JCR or YAML.

JCR Configuration

Configuration of the Microsoft service provider is handled in the module config. This provider should be configured with the following path:

modules
└── content-translation-support-ext-microsoft
    └── config
        └── translationProviders
            └── microsoftTranslationProviderConfigFile.yaml
For users upgrading from version 3.4.x to version 3.5, ensure you move your existing translation provider configuration to the correct path.

YAML configuration

Microsoft service provider configuration is defined within its provider module (magnolia-content-translation-support-ext-microsoft) under the following directory structure:

/src/main/resources/magnolia-content-translation-support-ext-microsoft/translationProviders

Required decorations

This configuration can also be decorated to override or extend the default configuration. Decoration file should be placed under the following path:

<light-module-name>/decorations/magnolia-content-translation-support-ext-microsoft/translationProviders

Below is an example of how to decorate Microsoft service provider configuration within a light module:

light-modules/
└── my-module/
    └── decorations/
        └── magnolia-content-translation-support-ext-microsoft/
            └── translationProviders/
                └── Microsoft.yaml

Configuration properties

This provider can be configured with the following properties.

Property Description

autoTranslationAllowed

optional , default is false

When true the content review process (workflow) is bypassed.

class

required

Definition class for the translator to be used.

See info.magnolia.translation.ext.provider.google.definition.MicrosoftProviderDefinition.

clientToken

required

Client secret for the client ID.

configName

required

Identifies the configuration within Magnolia.

defaultFlag

optional

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

implementationClass

required

Implementation class for interfacing with Microsoft.

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

Sample JCR configuration

'config':
  'jcr:primaryType': 'mgnl:content'
  'translationProviders':
    'Microsoft':
      'autoTranslationAllowed': 'false'
      'class': 'info.magnolia.translation.ext.provider.microsoft.definition.MicrosoftProviderDefinition'
      'clientToken': 'xxxxxxxxxxxxxxxxxxxx'
      'configName': 'Microsoft.com'
      'enabledFlag': 'true'
      'implementationClass': 'info.magnolia.translation.ext.provider.microsoft.translator.MicrosoftTranslator'

There may be some discrepancies between the supported languages from Magnolia system and Microsoft translation, so we provide the default configuration for mapping between those language codes in the config module.

microsoft lang mapping

Sample YAML decorated configuration

clientToken: xxxxxx-xxxxx-xxxx-xxxx-xxxx
enabledFlag: true

Usage

After registration and starting, The Content Translation Support Extended (CTSX) module will bind the Microsoft translator to Configuration fields.

You can test the connection to the translator api before using.

microsoft

How it works

Use the same steps outlined with CTSX Google Translator but you will choose Microsoft.com instead of Google.com in the Configuration.

Known issues

Text too large

In case of submitting many contents (such as the whole /travel page includes dependences), an error will be thrown as below. This is known issue as number of submitted segments is over microsoft’s threshold.

ERROR info.magnolia.translation.ext.provider.microsoft.translator.MicrosoftTranslator: Error occurred while translating
java.lang.RuntimeException: TEXT_TOO_LARGE - Microsoft Translator (Translate) can handle up to 10, 240 bytes per request
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