Add a Translatable Language

Overview

This page describes how to add a new translatable language to the content model in Bloomreach Content. For instructions on localizing the CMS user interface, see CMS UI localization.

Add a Content Translation Language

To add a new content translation language:

  1. Open the Console and navigate to:

    /hippo:configuration/hippo:frontend/cms/cms-services/localeProviderService
  2. Copy an existing child node under localeProviderService and rename it to match the locale you want to add.

  3. Update the country and language properties on the new node to reflect the desired locale. The CMS generates display strings for locales using the Java method java.util.Locale#getDisplayLanguage(java.util.Locale).

To override the default display string for a locale, add subnodes of type frontend:pluginconfig for each UI language. Set the hippo:language property to the language code and hippo:message to the display string you want to show.

For example, to override the display string for the en_GB locale:

/en_GB: jcr:primaryType: frontend:pluginconfig country: gb language: en /translation-en: jcr:primaryType: frontend:pluginconfig hippo:language: en hippo:message: UK English /translation-nl: jcr:primaryType: frontend:pluginconfig hippo:language: nl hippo:message: Brits Engels

In this example, the display string for UK English appears as "UK English" in English and "Brits Engels" in Dutch.

Add Custom Icons for a Language

You can provide custom icons if the default flag icons do not meet your requirements or if an icon is not available for a specific locale. The following country codes already have icons available:

ae, ar, at, au, be, bg, br, ca, ch, cn, cy, cz, de, dk, ee, es, fi, fr, gb, gr, hk, hu, id, ie, il, in, ir, it, jp, kr, lt, lu, lv, mt, mx, my, nl, no, nz, ph, pk, pl, pt, ro, ru, sa, se, sg, si, sk, th, tr, tr, ua, uk (deprecated: use 'gb' instead), us, vn, za

The country property in the locale provider service configuration acts as an identifier for icon lookup. It does not need to be a valid country code. You can use custom identifiers for project-specific icons.

To use custom icons (for example, with the identifier xx for the en locale):

  1. Set the country property of /hippo:configuration/hippo:frontend/cms/cms-services/localeProviderService/en to xx.
  2. Add the following icon files to your CMS module:
    • 11x9 pixel flag:
      cms/src/main/resources/org/hippoecm/frontend/translation/icons/flags/flag-11x9_xx.png
    • 16x16 pixel flag:
      cms/src/main/resources/org/hippoecm/frontend/translation/icons/flags/flag-16_xx.png
    • 16x16 pixel flag with plus sign:
      cms/src/main/resources/org/hippoecm/frontend/translation/icons/plus/flag-plus-16_xx.png
  3. Rebuild and restart your project to apply the changes.
Share Feedback
Page: /build/content-beans-translations/add-a-translatable-language
Section: Build
Category *