Content Translation Extended module
Edition |
Incubator (services) |
||
Issues |
|||
Git |
|||
Latest |
3.4.12
|
The Content Translation Support Extended (CTSX) module enables you to translate content automatically. This module comes with several apps which are used to manage the translation tasks.
This module is at the INCUBATOR level.
|
- OpenJDK Java 11 needs additional dependencies
Expand to see dependencies
<!-- For OpenJDK 11 CTE 3.0 you will need to have the following dependencies -->
<!-- in your web app lib folder-->
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>javax.jws</groupId>
<artifactId>javax.jws-api</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>rt</artifactId>
<version>2.2.10</version>
</dependency>
<dependency>
<groupId>com.sun.org.apache.xml.internal</groupId>
<artifactId>resolver</artifactId>
<version>20050927</version>
</dependency>
<dependency>
<groupId>com.sun.xml.stream.buffer</groupId>
<artifactId>streambuffer</artifactId>
<version>1.5.6</version>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>policy</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.messaging.saaj</groupId>
<artifactId>saaj-impl</artifactId>
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>org.glassfish.gmbal</groupId>
<artifactId>gmbal-api-only</artifactId>
<version>3.2.0-b003</version>
</dependency>
<dependency>
<groupId>jakarta.xml.ws</groupId>
<artifactId>jakarta.xml.ws-api</artifactId>
<version>3.0.1</version>
</dependency>
- From Magnolia version 6.2.39, you need additional dependencies in your webapp
Expand to see dependencies
<!-- Manage versions of content-editor to v2 -->
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-link-unfurl</artifactId>
<version>${contentEditor2Version}</version>
</dependency>
<dependency>
<groupId>info.magnolia.block</groupId>
<artifactId>magnolia-block-api</artifactId>
<version>${contentEditor2Version}</version>
</dependency>
<dependency>
<groupId>info.magnolia.block</groupId>
<artifactId>magnolia-block-templating</artifactId>
<version>${contentEditor2Version}</version>
</dependency>
<dependency>
<groupId>info.magnolia.editor</groupId>
<artifactId>magnolia-content-editor</artifactId>
<version>${contentEditor2Version}</version>
</dependency>
<dependency>
<groupId>info.magnolia.editor</groupId>
<artifactId>stories-app</artifactId>
<version>${contentEditor2Version}</version>
</dependency>
<dependency>
<groupId>info.magnolia.editor</groupId>
<artifactId>magnolia-content-editor-widgetset-v2</artifactId>
<version>${contentEditor2Version}</version>
</dependency>
Installing with Maven
Maven is the easiest way to install the module. Add the following to your bundle:
Installation on JDK 11 needs extra dependencies. Please see the warnings section of this document. |
<dependency>
<groupId>info.magnolia.translation</groupId>
<artifactId>magnolia-content-translation-support-ext-core</artifactId>
<version>3.4.12</version>
</dependency>
<dependency>
<groupId>info.magnolia.translation</groupId>
<artifactId>magnolia-content-translation-support-ext-core</artifactId>
<version>3.0.5</version>
</dependency>
<dependency>
<groupId>info.magnolia.translation</groupId>
<artifactId>magnolia-content-translation-support-ext-core</artifactId>
<version>2.9.8</version>
</dependency>
<dependency>
<groupId>info.magnolia.translation</groupId>
<artifactId>magnolia-content-translation-support-ext-core</artifactId>
<version>2.9.4</version>
</dependency>
Usage
Content Translation Support Extended (CTSX) enables you to translate content automatically over a translation provider ensuring a more accurate translation. Translation is done from a base language, typically English, to a target language. The base language should exist as content within your website or content app as properties. The target languages should be configured in your site definition. See Enabling multilanguage content for more information.
The Configuration shown here reflects usage with Magnolia 6.2. If you use an older version of Magnolia, see Pre 6.1 Usage. |
Configuration
Parameter | Description | ||
---|---|---|---|
|
required; taken from default Module Content Translation Defines the field types that are going to be translated. Default is text and richText; possible values are composite and multiValue.
|
||
|
required The class that finds the properties to be translated. Default value: |
||
|
optional From version 2.9.7, 3.0.3
Defines the source languages. The default is the value in the site definition |
Translation providers
There are several translation providers to choose from: CTSX Google Translator, CTSX Microsoft Translator, CTSX Translations.com, CTSX AT Language Solutions, CTSX DeepL Translator, and CTSX Instant Translation. To make use of the translation functionality, a user account is required for the chosen provider.
A translator module connects Magnolia to translation services. The behavior of the service depends on the translation service selected.
Service | Notes |
---|---|
Synchronous |
Directly returns the translated result for each translation request.
|
Asynchronous |
Does not return the translated result for each translation request. A second request is required to get the translated result.
|
Common properties
Property | Description |
---|---|
|
optional When true the content review process (workflow) is bypassed. |
|
required Definition class for the translator to be used. |
|
required The display name of the configuration in Magnolia. |
|
required Set the translator to be the default. |
|
required Enables or disables the configuration with |
|
required Implementation class for the translation service. |
|
optional Exported fields are filled in with the original values by default, to disable this behaviour set this property to |
Translation Extend app
The module comes with the Translation Extend app which can be found under the tools menu of the applauncher. This app extends the functionality of Content Translation in the sense that translations can now be automatized. It is still possible to export the automatized translations from the Content Translation app after receiving them.
Translation subapps
The app is made up of several subapps for managing translation files and submissions.
-
Batches: In the Batches subapp users can
-
Add a new or edit an existing batch.
-
Submit a batch for translation.
-
Get the history of the batch.
-
Cancel a batch submission.
-
Reload an existing batch.
-
-
Histories: Allows for viewing and managing the batch histories.
-
Queues: Allows for managing the translation submission.
-
Comparison: Allows you to compare original and translated values before importing or rejecting.
Translation status
Once a batch is created it has a status. The status is visible from Batches subapp.
Status | Description |
---|---|
|
Created and not yet submitted. |
|
Processing and submitted. |
|
The content was imported. |
|
The translation has been rejected by the reviewer. |
|
Cancelled |
|
Translation expired. |
|
An error occurred. |
Workflow
This module provides a workflow for users to review and approve translated content. If the setting autoTranslationAllowed
is true
then the content is imported directly without a review step. Otherwise the content review workflow process is started.
The workflow is identical in nature to the 4-eye content approval workflow used for the Pages app. In this case the editor is the translation provider and the reviewer can be any person in the group. To configure your desired group, change the property here: /modules/content-translation-support-ext-core/tasks/reviewTranslation/groups@publishers
.
Message views
Workflow message views define how messages display in Pulse during translation workflow. See Message view definition for more details.
Message views are configured here: /modules/content-translation-support-ext-core/messageViews .
|
Work item handlers
The mapping is based on the work item name which is added to the jBPM process definition. There are two handlers configured for the workflow process.
-
approve: Handles importing translated content after approval
-
reject: Handler for content rejection
Work item handlers are configured here: /modules/content-translation-support-ext-core/workItemHandlers .
|
Translation jobs
The core module installs three scheduled jobs to automate the translation process. The translation is submitted to the translation provider. In the case of Translations.com or AT Language Solutions, a second request is required to retrieve the translation results. Finally, the translation is either directly imported or the workflow process is initiated.
The jobs are configured under: /modules/scheduler/config/jobs .
|
Submitting
The submitTranslationToExternalServiceJob
sends translation submission requests to the provider.
# Configuration shown in YAML but must exist as a JCR Node.
submitTranslationToExternalServiceJob:
catalog: workflowTranslation
command: submitTranslationToExternalServiceProcessCommand
cron: 1/60 * * * * ? # set to execute every minute at 1 second past the minute
description: Output, Send, Update translation batch
enabled: true
concurrent: false
params:
maxAttempt: 10 # define the max retry for each item
Retrieving
The retrieveTranslationResultFromExternalServiceJob
is for asynchronous translation. For translating services that require a second request to retrieve the translations you will need to use this job as well.
# Configuration shown in YAML but must exist as a JCR Node.
retrieveTranslationResultFromExternalServiceJob:
catalog: workflowTranslation
command: retrieveTranslationResultFromExternalServiceProcessCommand
cron: 5/60 * * * * ? # set to execute every minute at 5 seconds past the minute
description: Get translation from provider
enabled: true
concurrent: false
params:
maxAttempt: 10 # define the max retry for each item
Importing
The startImportWorkflowOrAutoImportJob
imports the translation immediately or starts the workflow. The behavior is set by autoTranslationAllowed
property in the translator configuration.
# Configuration shown in YAML but must exist as a JCR Node.
startImportWorkflowOrAutoImportJob:
catalog: workflowTranslation
command: startImportWorkflowOrAutoImportJob
cron: 0/30 * * * * ? # set to execute every 30 seconds
description: Import or create import workflow
enabled: true
concurrent: false
params:
maxAttempt: 10 # define the max retry for each item
Clean up imported submission job
The cleanUpImportedSubmissionJob
clean up the successful batch, imported translation and all related histories from the workspace.
# Configuration shown in YAML but must exist as a JCR Node.
'cleanUpImportedSubmissionJob':
'command': 'cleanUpImportedSubmission'
'catalog': 'workflowTranslation'
'cron': '0 0/10 * 1/1 * ? *'
'description': 'Clean up imported submission'
'enabled': true
'concurrent': false
'params':
'minusDays': '14' #get record has lastModified from the pass
'numOfBatchPerProcess': '10'
What is exported and imported
By default, text and rich text fields are included in export files. Additional field types may be registered here: /modules/translation/config/supportedFieldDefinitions
. Add another property with the value set to the definition class of the field that should be included.
In addition to registration, the child fields of the composite field should have an i18n
property set to true
.
compositeFieldI18nChildNodeChildrenI18n:
label: compositeField
$type: compositeField
i18n: true
itemProvider:
$type: jcrChildNodeProvider
propertyNameDecorator: info.magnolia.ui.field.PrefixNameDecorator
properties:
- name: textField1
label: textField1
$type: textField
i18n: true
- name: textField2
label: textField2
$type: textField
i18n: true
Notification Email
Magnolia uses Mail module to send a notification email to submitter in case of errors. The template provided is here. The notification email template is configured here: /modules/mail/config/templatesConfiguration/translationNotificationTemplate
.
Changelog
Version | Notes |
---|---|
|
Release notes for 3.1.12:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Initial release of the extensions version of the module. |