Use automatic translation of content in the CMS - BloomReach Experience - Open Source CMS

This article covers a Hippo CMS version 11. There's an updated version available that covers our most recent release.

04-07-2016

Use automatic translation of content in the CMS

Hippo CMS offers a way to have a document automatically translated when a translation is created. This feature is based on the google translate service and requires a google translate key to use.

To enable this feature add the follwing workflow configuration at the node /hippo:configuration/hippo:workflows/translate:

<sv:node sv:name="hippotranslation:translated">
  <sv:property sv:name="jcr:primaryType" sv:type="Name">
    <sv:value>hipposys:workflow</sv:value>
  </sv:property>
  <sv:property sv:name="hipposys:classname" sv:type="String">
    <sv:value>org.onehippo.translate.TranslateWorkflowImpl</sv:value>
  </sv:property>
  <sv:property sv:name="hipposys:display" sv:type="String">
    <sv:value>Translation workflow</sv:value>
  </sv:property>
  <sv:property sv:name="hipposys:nodetype" sv:type="String">
    <sv:value>hippotranslation:translated</sv:value>
  </sv:property>
  <sv:node sv:name="hipposys:types">
    <sv:property sv:name="jcr:primaryType" sv:type="Name">
      <sv:value>hipposys:types</sv:value>
    </sv:property>
  </sv:node>
  <sv:node sv:name="hipposys:config">
    <sv:property sv:name="jcr:primaryType" sv:type="Name">
      <sv:value>nt:unstructured</sv:value>
    </sv:property>
    <sv:property sv:name="google.key" sv:type="String">
      <sv:value>[ your-google-translate-api-key ]</sv:value>
    </sv:property>
  </sv:node>
</sv:node>

This will activate automatic translation for any document type that has (inherited) the mixin node type hippotranslation:translated. You can also bind to a different node type, such as a base document type, or a specific document type. To use the Google Translate API, a key must be acquired from https://console.developers.google.com/.

Another property "timeout" defines how long each translation request is allowed to take (in milliseconds). In case of timeouts or other errors, the translate-content operation is aborted and a message is presented to the user. However the translated document is still made available, as if no translate service had been configured.

The implementation will scan for fields in the document that require translation and run them through the translation service. Due to limitations of the translate service, not all text is always translated. Only fields that are of types Text or are Rich text fields ( hippostd:html) are offered to the translate service. String fields are not translated, as they mostly contain labels rather than translatable text.

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?