The CTS Common module defines the API and basic configurations which support the CTS Auto Translation, CTS Workflow and CTS Translations.com modules.

Installing

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

<dependency>
  <groupId>info.magnolia</groupId>
  <artifactId>magnolia-module-content-translation-support-extend-common</artifactId>
  <version>2.0.0</version>
</dependency>

Pre-built jars are also available for download. See Installing a module for help.

Configuration

The module is configured in /modules/content-translation-support-extend-common.

Node nameValue

 modules

 

 content-translation-support-extend-common

 

 config

 

 commands

 

 fieldTypes

 

Translators

Translators connect Magnolia to external translation services. The translator configurations contain access credentials and are discussed in the individual module documents.

Translators for all supported CTS modules are registered in the CTS Common module.

Translators are configured in /modules/content-translation-support-extend-common/config/translators

Node name

 config

 translators

 Google

 Microsoft

 TranslationsCom

Languages select field

The Languages select field allows the user to select target languages for translation. All configured languages (except fallback) are available for selection automatically. The field is used in dialogs in the supported CTS modules. See Enabling mulitlanguage content for how to set up languages.  

The field is registered in /modules/content-translation-support-extend-common/fieldTypes/languageSelectField.  

Node nameValue

 fieldTypes

 

 languageSelectField

 

 definitionClass

info.magnolia.module.contenttranslationsupport.extend.common.field.LanguagesSelectFieldDefinition

 factoryClass

info.magnolia.module.contenttranslationsupport.extend.common.field.LanguagesSelectFieldFactory 

Here's an example of its use.

Example: Translation request dialog in the CTS Auto Translation module configured in /modules/content-translation-support-extend-auto-translation/dialogs/autoTranslationRequest/form/tabs/translation/fields/targetLangs.

Node nameValue

 fields

 

 targetLangs

 

 class

info.magnolia.module.contenttranslationsupport.extend.common.field.LanguagesSelectFieldDefinition

 label

Target languages

 leftColumnCaption

Configured languages

 required

true 

 rightColumnCaption

Selected languages

Properties:

<field name>

required

Field name.

<property name>

required/optional

Field properties.

LanguagesSelectFieldDefinition supports all:

leftColumnCaption

optional, default is From

Text displayed above the left column.

rightColumnCaption

optional, default is To

Text displayed above the right column.

Commands

The module includes a number of custom translation command classes (see list below), many of which are registered in the supported CTS modules.

Two commands, ImportTranslationCommand and ScheduledConditionCommand,  are registered in the CTS Common module in /modules/content-translation-support-extend-common/commands/common.

Node nameValue

 commands

 

 common

 

 importCommand

 

 class

info.magnolia.module.contenttranslationsupport.extend.common.command.ImportTranslationCommand

 scheduleImportCommand

 

 config

 

 expectedStatuses

 

 Translated

Translated

 catalogName

common

 commandName

importCommand

 class

info.magnolia.module.contenttranslationsupport.extend.common.command.ScheduledConditionCommand

Properties:

common

required

Common catalog.

importCommand

required

Import command.

class

required

ImportTranslationCommand imports translated content in XLIFF format.

scheduleImportCommand

required

Schedule Import command.

config

required

Configuration node.

expectedStatuses

required

Expected statuses node.

Translated

required

Expected status.

catalogName

required

Catalog where the triggered command resides.

commandName

required

Name of triggered command.

class

required

ScheduledConditionCommand executes another command when a CommandCondition is met. In this configuration it triggers the import command when expectedStatuses is Translated.

List of commands: 

CommandDescriptionRegistered in

info.magnolia.module.contenttranslationsupport.extend.common.command. CancelTranslationCommand

Cancels a translation task.CTS Workflow

info.magnolia.module.contenttranslationsupport.extend.common.command. ExecuteByStatusCommand

Executes another command when ExpecedStatuses condition is met.CTS Translations.com

info.magnolia.module.contenttranslationsupport.extend.common.command. ExportTranslationCommand

Converts translatable content into XLIFF format

CTS Auto Translation

CTS Workflow

info.magnolia.module.contenttranslationsupport.extend.common.command. ImportTranslationCommand

Imports translation result in XLIFF format into content.

CTS Common

CTS Auto Translation

info.magnolia.module.contenttranslationsupport.extend.common.command. ScheduledConditionCommand

Executes another command when CommandCondition is metCTS Common

info.magnolia.module.contenttranslationsupport.extend.common.command. TranslateCommand

Calls external translation service to translate with selected translator.

CTS Auto Translation

CTS Translations.com 

info.magnolia.module.contenttranslationsupport.extend.common.command. TranslationTrackingCommand

Tracks translation progress.CTS Auto Translation

Action definition classes

The CTS Common module includes two custom action definition classes:

info.magnolia.module.contenttranslationsupport.extend.common.action. OpenTranslateDialogActionDefinition

Opens a translate dialog. See Enabling automatic translation in content apps for a usage example.

info.magnolia.module.contenttranslationsupport.extend.common.action. TranslateDialogCommandAction

Translate action. Used for commit action in translate dialog. See Translate request dialog for a usage example.
#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))