The Translate Content Sub-Action allows content to be automatically translated from any language version to any other content language version that has been installed on the dotCMS server and configured on the Translate Content Sub-Action.
Adding the Sub-Action to an Action
The steps below define how to set up auto-translation of content via a custom workflow. However, please be advised that the resulting translations will be imperfect, and should be reviewed and revised by content contributors that are proficient in each supported language.
First, make sure that you have installed all the language versions that you wish to support in your dotCMS instance.
Next, create a custom workflow that you would like to apply to your Content Types.
Then add the “Translate Content” sub-action to the custom workflow as show below.
After choosing the “Translate Content” sub-action, click on the sub-action to configure the translation parameters.
The Translate Content sub-action has three parameters:
- Translate to: allows the “all” parameter to translate content for each installed language version on the dotCMS instance, or a comma separated list of each two letter language code can be added (Ex: es, fr, zh, etc.)
- Translate Field Types: Define field types that should be translated (Ex: text, wysiwyg, textarea, etc.)
- Ignore Fields: (optional) Provide a list of exception field types (by velocity variable name), that should NOT be translated. Velocity variable names for each field can be examined when editing the Content Type.
- Service API Key: (optional) The API key for your translation service can be placed here, or added to your dotCMS server configuration properties. If the app has been configured (see below), the key will automatically display in the Service API Key field. However, if the configuration property has not been set, the Service API Key field will be empty, and must be set in the sub-action parameters, otherwise the content will not be translated by the subaction.
Translation Service API Key Configuration
dotCMS includes a built-in app integration for Google Translate, accessible through Settings → Apps. This is capable of being configured on a per-site basis, or globally by using the System Host entry. Click the appropriate line and you will be prompted to enter your key.
Using the Subaction in a Workflow
After adding the custom workflow scheme to the Content Type properties, then your custom workflow button(s) should appear when editing content. Simply create the content in any single language, then click the custom workflow action that is tied to the “Translate Content” workflow sub-action. The content will be saved and the configured translations and content versions will be created.