Custom Translations

This article explains how to add and configure custom translations to the Activiti task management in the CMS. These custom translations can be used to render translated messages for form fields in custom processes.

1 Configure Custom Translations

When creating a custom process there may be the need for a form which is displayed to the user automatically by the task management app. In an activiti process a form is usually configured like this:


	<activiti:formProperty id="numberOfDays" name="Number of Days" type="long"/>
	<activiti:formProperty id="firstName" name="First Name" type="string" />
	<activiti:formProperty id="lastName" name="Last Name" type="string" />

The description of each form element is displayed to the user (per default untranslated). To display the text translated you can configure custom resource bundles. These bundles need to be deployed with the custom process and need to be available in the task management app’s classpath in the java package “com.gentics.contentnode.activiti.i18n.custom”.

To include translations for German and English two files are needed in the package:

  • (which holds the English translations)
  • (which holds the German translations)

myprocess.number-of-days=Number of Days
myprocess.firstname=First name
myprocess.lastname=Last name

myprocess.number-of-days=Anzahl an Tagen

The task management app needs to be configured to use the bundles

# Configure a list of custom translations (Java ResourceBundle names)

and in the process definition the keys of the translations must be used instead of the textual description


	<activiti:formProperty id="numberOfDays" name="myprocess.number-of-days" type="long"/>
	<activiti:formProperty id="firstName" name="myprocess.firstname" type="string" />
	<activiti:formProperty id="lastName" name="myprocess.lastname" type="string" />

All ResourceBundles are loaded in the order they are configured. If two bundles contain the same key the translation of the last configured bundle will be used.

2 Overriding Core Translations

Overriding core translations is not part of the official API since translation keys can change without notice between releases! Use at your own risk!

Create a ResourceBundle with custom translations for the core place it in the java package “com.gentics.contentnode.activiti.i18n.core” and deploy it with the task management app.

# Configure a list of core translations
# Messages-Core is the default ResourceBundle for translations