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:
-
Open the Console and navigate to:
/hippo:configuration/hippo:frontend/cms/cms-services/localeProviderService -
Copy an existing child node under
localeProviderServiceand rename it to match the locale you want to add. -
Update the
countryandlanguageproperties on the new node to reflect the desired locale. The CMS generates display strings for locales using the Java methodjava.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):
- Set the
countryproperty of/hippo:configuration/hippo:frontend/cms/cms-services/localeProviderService/entoxx. - 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
- 11x9 pixel flag:
- Rebuild and restart your project to apply the changes.