Add internationalization (i18n) to document types - BloomReach Experience - Open Source CMS

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

26-04-2018

Add internationalization (i18n) to document types

Internationalization of document type string

The Bloomreach Experience Manager user may login with different languages. You can add translations for document types so the users can see document type names, field captions and field hints in their own language. These translations can be added or changed using the Bloomreach Experience Manager Console.

To add English (en) and Dutch (nl) translations for the document type myhippoproject:mytype, make sure auto-export is turned on, and navigate in the console to the node /hippo:configuration/hippo:translations/hippo:types. This is the location that the CMS uses to load translations for document types. Then add a node of type hipposys:resourcebundles with the name myhippoproject:mytype to hippo:types. Then add two nodes of type hipposys:resourcebundle to myhippoproject:mytype with the names en and nl.

In the resource bundle nodes, you can add the strings that are shown in the UI. To add a translation for the document type string itself, add a property called jcr:name with type String to both the en and nl nodes and give it a value. To add a translation for the field called "title", add a property myhippoproject:title with type String to both the en and nl nodes and give it a value. It is also possible to provide translations for the hints that are shown in the document editor. To add a hint for the title field, add a property myhippoproject:title#hint with type String and give it a value.

By now the console should look something like this:

And the document type editor when logged in using Dutch should look something like this:

If you enable auto-export, it will have exported the following in repository-data/application/src/main/resources/hcm-config/configuration/translations/types.yaml:

definitions:
  config:
    /hippo:configuration/hippo:translations/hippo:types/myhippoproject:mytype:
      jcr:primaryType: hipposys:resourcebundles
      /en:
        jcr:primaryType: hipposys:resourcebundle
        jcr:name: My Type
        myhippoproject:title: Title
        myhippoproject:title#hint: Title hint
      /nl:
        jcr:primaryType: hipposys:resourcebundle
        jcr:name: Mijn Type
        myhippoproject:title: Titel
        myhippoproject:title#hint: Titel hint
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?