Blueprint Developer Manual / Version 2304
Table Of ContentsThis section describes general configuration options for translation workflows.
Note
The necessary Spring configurations for new custom workflows in Studio are documented within Section 9.26, “Custom Workflows” in Studio Developer Manual.
Spring configuration for custom translation workflows
A new custom translation workflow requires a strategy for extracting derived contents from your customTranslation.xml workflow definition. Therefore, you need to introduce a bean definition from the class com.coremedia.translate.workflow.DefaultTranslationWorkflowDerivedContentsStrategy and adapt it to your custom workflow (see example below).
Note
There is already a default bean with the "id" defaultTranslationWorkflowDerivedContentsStrategy, that is defined for the processDefinitionName "Translation".
<bean id="customTranslationWorkflowDerivedContentsStrategy" class="com.coremedia.translate.workflow.DefaultTranslationWorkflowDerivedContentsStrategy"> <description> A strategy for extracting derived contents from the custom translation.xml workflow definition. </description> <property name="processDefinitionName" value="customTranslation"/> <property name="derivedContentsVariable" value="derivedContents"/> <property name="masterContentObjectsVariable" value="masterContentObjects"/> </bean>
Example 5.37. Example for a
customTranslationWorkflowDerivedContentsStrategy
The bean needs to be customized in the Workflow Server web application, for example with a
Blueprint extension module with Maven property coremedia.project.extension.for
set to workflow-server
.
Translation Workflow Properties
studio.translation.showPullTranslationStartWindow
| |
Description |
Use this property to show the workflow start dialog in Studio also for translations into the preferred site (pull translations). The pull translation always uses the first available translation workflow. If you have multiple workflow definitions, it might be necessary to select the appropriate workflow definition from the available workflows. Possible values:
|
Default Value | FALSE
|
studio.workflow.translation.extendedWorkflow
| |
Description |
Use this property to define the amount of dependent content, that will be shown in a translation workflow window. |
Default Value | 100
|
Table 5.23. Translation Workflow Properties
XLIFF Configuration
XLIFF Configuration Properties
The handling of empty translation units during XLIFF import can be configured using the following properties:
translate.item.include-unchanged-properties
| |
Description |
Configure whether properties that have not changed since last translation are also included in items for translation.
Possible values are: |
Default Value | true |
translate.item.transform.failure.mode
| |
Description |
Configure the strictness of the XLIFF Export pre-processing regarding missing
property transformers. If mode is
Possible values are: |
Default Value | fail |
translate.xliff.export.handler.failure.mode
| |
Description |
Configure the strictness of the XLIFF Export regarding missing property export
handlers. If mode is
Possible values are: |
Default Value | fail |
translate.xliff.import.emptyTransUnitMode
| |
Description |
Configure handling of empty trans-unit targets for XLIFF import. Possible values:
|
Default Value | IGNORE_WHITESPACE
|
translate.xliff.import.ignorableWhitespaceRegex
| |
Description |
Configure the regular expression that determines which characters are counted as
ignorable whitespace. This configuration is only used when
|
Default Value | [\\s\\p{Z}]* |
translate.xliff.import.xliffValidationMode
| |
Description |
Configure XLIFF validation behavior. Possible values:
|
Default Value | FAIL_ON_WARNING
|
translate.xliff.export.excludeContentName
| |
Description |
Configure the flag that determines, whether the name of content in a translation workflow will be excluded in an XLIFF-Export. Caution
Including content names into translation may harm your system. Thus,
if you set this property to |
Default Value | true |
Table 5.24. XLIFF Properties
XLIFF Configuration Beans
In addition to the properties you can customize the following XLIFF beans in your application context:
translate.xliff.translatableExpressions
This is a list bean with string entries. Each entry specifies an expression to identify content type properties which should be marked as translatable and thus will be part of the XLIFF Export. The same property types are supported as for the
extensions:translatable
content type model setting (see Chapter 4, Developing a Content Type Model in Content Server Manual for details).While it is recommended to use
extensions:translatable
in favor of these expressions, the translatable-expressions provide support for nested Struct property value access, which is not possible within the content type model. Thus, the intended use case is to specify selected elements of Struct properties which should be part of the XLIFF file while the Struct property itself is not translatable.This bean is available through Maven artifact
com.coremedia.cms:cap-translate-item
, which is by default a transitive dependency of Blueprint Studio and Workflow Server.- Example:
<customize:append id="blueprint.translate.xliff.translatableExpressions" bean="translate.xliff.translatableExpressions"> <list> <value>CMLinkable.localSettings.callToActionCustomText</value> <value>CMLinkable.localSettings['entry.with.dots'].childEntry</value> </list> </customize:append>
Example 5.38. translatableExpressions Configuration Example
- Expression Syntax:
The first two elements of the expression define the content type and the property which should be known as (partially) translatable. Following elements define sub-elements within the property. This is currently only supported for Structs. The content type must be the content type which also defines the property.
The expressions support separate properties either by periods or by strings in square brackets. Thus,
CMLinkable.localSettings
is the same asCMLinkable['localSettings']
.- Limitations:
Using this mechanism to mark properties inside Structs as being translatable works for String and Markup properties. For the latter, only the grammar
coremedia-richtext-1.0
is fully supported.Alternatively, you can add the bean
RichtextInStructTranslatablePredicate
to your application context to mark all richtext markup properties inside Structs as being translatable.