Magnolia 5.5 reached end of life on November 15, 2019. This branch is no longer supported, see End-of-life policy.
The CTS T ranslations.com module extends the functionality of the CTS Workflow module to allow files to be sent to Translations.com for translation.
The module adds:
Please read the CTS Workflow module documentation before proceeding with this document.
This module:
globallink-connect-api-4.18.2.jar
which is available to Translations.com account holders. Please contact magnolia@translations.com for details or support.The module is configured in /modules/content-translation-support-extend-ct-integration
.
Node name | Value |
---|---|
modules | |
content-translation-support-extend-ct-integration | |
commands |
The module can be used in the three different ways detailed in this section. You can use different processes in different apps or any combination of these processes.
This method describes the process of a reviewer sending a single content item to a translator who forwards the item to Translations.com.
The CTS Demo module:
reviewers
and translators
. superuser
is assigned to the reviewers group and eric
to the translators group. Here's how the Translations.com integration works for single content items:
Batch translation allows a reviewer (superuser) to send multiple content items to the translators group at the same time. The items are managed in the Translation Submit app.
The CTS Translations.com module enables batch content translation in the Pages app.
Except for step 1, the procedure is basically the same as for single content items.
Here's how step 1 works for batch items:
Reviewer (superuser):
You can add content items from different workspaces to the same batch by enabling batch translation in the underlying apps. For example you could add relevant tours, pages, contacts and tour categories to a campaign batch by adding the Add to translation requests action in the different apps..
You can configure Magnolia to import translated content uploaded from Translations.com directly into the JCR. This bypasses the review process (step 5 above). See Enabling auto import for more.
The module includes a translator implementation that integrates Magnolia with Translations.com.
The translator is configured in the CTS Common module at /modules/content-translation-support-extend-common/config/translators
.
Node name | Value |
---|---|
content-translation-support-extend-common | |
config | |
translators | |
TranslationsCom | |
config | |
class | info.magnolia.module.contenttranslationsupport.extend.ct.translator.TranslationsComConfig |
password | YourPasswordHere |
projectCode | YourProjectCodeHere |
submissionPrefix | magnolia- |
url | https://yourTranslations.comInstanceHere/instance |
userAgent | YourUserAgentHere |
username | YourUserNameHere |
class | info.magnolia.module.contenttranslationsupport.extend.ct.translator.TranslationsComTranslator |
default | true |
identifier | Translations.com |
name | Translations.com |
Properties:
translators | required Translators node in the CTS Common module. |
| required Translator name. |
| required Translator configuration node. |
| required Translations.com credentials.
|
| required Implements |
| required Whether to use the default Translations.com settings. |
| required Translator identifier. |
| required Translator name. |
The module adds the Request translations.com action to the translate
message view configured in the CTS Workflow module.
The action is configured in /modules/content-translation-support-extend-workflow/messageViews/translate/actions/translateByTranslator
.
Node name | Value |
---|---|
content-translation-support-extend-workflow | |
messageViews | |
translate | |
actions | |
translateByTranslator | |
rules | |
availability | |
CanProceedTaskRule | |
IsExportedRule | |
writePermissionsRequired | true |
params | |
translator | Translations.com |
catalog | ctIntegration |
class | info.magnolia.module.contenttranslationsupport.extend.workflow.action.MessageViewCommandActionDefinition |
command | requestTranslationCommand |
icon | icon-content-translation-app |
successMessage | Sent request to translations.com successfully, wating for response |
taskState | Requested translations.com, waiting for response |
Properties:
actions | optional Message view actions node. |
| optional Availability node. |
| optional Rules node. |
| required Rule name.
|
| optional, default is Enables action for users with Read/Write permissions. |
| optional Parameters node. |
| optional Translator name. |
| required Translations.com command catalog. |
| required $webResourceManager.requireResource("info.magnolia.sys.confluence.artifact-info-plugin:javadoc-resource-macro-resources")
MessageViewCommandActionDefinition
extends CommandActionDefinition to support taskState property. |
| required Command name. |
| optional Action icon. |
| optional Message displayed in the Pulse on successful execution. |
| optional Task state displayed in the Pulse on successful execution. |
The action is added to the action bar in /modules/content-translation-support-extend-workflow/messageViews/translate/actionbar/sections/workflowActions/groups/translationActions/items/translateByTranslator
.
Three commands are registered in /modules/content-translation-support-extend-ct-integration/commands/ctIntegration
.
Node name | Value |
---|---|
commands | |
ctIntegration | |
receiveTranslatedContentCommand | |
receiveContentCommand | |
updateTaskStatusCommand | |
class | info.magnolia.module.contenttranslationsupport.extend.workflow.command.UpdateWorkflowTaskStatusCommand |
decision | approve |
requestTranslationCommand | |
translateCommand | |
updateTaskStatusCommand | |
executeByStatusCommand | |
commands | |
Sent | |
expectedStatuses | |
Sent | Sent |
catalogName | ctIntegration |
commandName | receiveTranslatedContentCommand |
jobRepeatCount | 0 |
Sent | 0 |
class | info.magnolia.module.contenttranslationsupport.extend.common.command.ExecuteByStatusCommand |
Properties:
commands | optional Commands folder. |
| required Translations.com integration catalog. |
| required Command class (see table below). |
| required/optional Properties supported by the command class. |
Command classes:
Command name | Class | Other properties |
| ||
|
| - |
|
| decision =approve |
requestTranslationCommand | ||
|
| - |
|
| decision =approve |
Used in scheduled job (see next section). |
|
|
Magnolia uses the Scheduler module to receive translated content back from Translations.com.
The scheduled job is configured in /modules/scheduler/config/jobs/checkAndExecuteTranslationCommands
.
Node name | Value |
---|---|
scheduler | |
config | |
jobs | |
checkAndExecuteTranslationCommands | |
catalog | ctIntegration |
command | executeByStatusCommand |
cron | 0/10 * * * * ? |
description | Get all translation statuses and execute commands every 10 seconds |
enabled | true |
Properties:
jobs | required Jobs node. |
| required Name of the job. |
| required ctIntegration catalog. |
| required Command name.
|
| required CRON expression that executes the job every 30 seconds. |
| optional Description of the job |
| optional, default is Enables and disables the job. |
You can enable Translations.com batch workflow in any content app.
Example: Enabling translations.com workflow in the Tours app.
Ensure that the fields you want to translate have an i18n
property (set to true
) in the detail
subapp. See Enabling mulitlanguage content for more.
Example: description
text field in the tours
tab in /modules/tours/apps/tours/subApps/detail/editor/form/tabs/tour/fields/description
.
Node name | Value |
---|---|
editor | |
form | |
tabs | |
tours | |
fields | |
name | |
description | |
class | info.magnolia.ui.form.field.definition.TextFieldDefinition |
i18n | true |
rows | 3 |
Add the Add to translation requests (selectTranslationBatch
) action to the browser
supapp.
Example:
selectTranslationBatch
action in /modules/tours/apps/tours/subApps/browser/actions/selectTranslationBatch
.
Node name | Value |
---|---|
browser | |
actions | |
selectTranslationBatch | |
extends | /modules/content-translation-support-extend-ct-integration/actions/selectBatchTranslationAction |
Add the action to the action bar.
Example:
selectTranslationBatch
action in /modules/tours/apps/tours/subApps/browser/actionbar/sections/item/groups/importExportActions/items/selectTranslationBatch
.
Node name |
---|
browser |
actionbar |
sections |
item |
groups |
importExportActions |
items |
selectTranslationBatch |