Taxonomy Plugin Localization
Introduction
Goal
Localize your taxonomies.
Summary
The Taxonomy Plugin supports localization out-of-the-box. Category names and descriptions can be translated within the taxonomy editor. Supported locales can be configured per taxonomy.
The labels for taxonomy fields in document types can be translated using resource bundles.
Taxonomy Category Localization
Categories in a taxonomy can be localized. The desired set of languages can be specified when the taxonomy is created in the setup application.
If the set of available languages doesn't contain a language you want to add, you can add it manually through the Bloomreach Experience Manager Console at
/content/taxonomies/[taxonomy-handle-node]/[taxonomy-node]/@hippotaxonomy:locales
For example:
/content/taxonomies: /exampletaxonomy: jcr:primaryType: hippo:handle /exampletaxonomy: jcr:primaryType: hippotaxonomy:taxonomy hippotaxonomy:locales: [en, nl]
Any valid locale name (for example, en, en_US, en_GB, nl, nl_NL, nl_BE) is supported.
A category can be localized by specifying a (translated) name and description for each language in the taxonomy editor:
See the JCR Tree Model page how the localized information for a category is stored, before and after version 15.3.
Default Locale
A taxonomy can have a default locale. It’s value can be modified by admins, in the taxonomy editor:
The dropdown contains the languages that are already present on the tree in the multi-valued property hippotaxonomy:locales.
The default locale is stored in the hippotaxonomy:defaultLocale property on the taxonomy tree:
/content/taxonomies: /exampletaxonomy: jcr:primaryType: hippo:handle /exampletaxonomy: jcr:primaryType: hippotaxonomy:taxonomy hippotaxonomy:defaultLocale: en hippotaxonomy:locales: [en, nl]
The default locale is used as fallback for content editors, in the document editors (both in the Content app and in the Experience Manager) and in the taxonomy picker, in case the document’s locale is not supported by the taxonomy tree.
An example use case for the default locale is when the categories are stored with non-descriptive keys and JCR node names (e.g. just numbers) but with good English names. Without French translations, the English names are shown for documents in a French content tree.
Taxonomy Field Translations for Document Types
Taxonomy Field (15.3 and newer)
When using the Taxonomy field type, localization can be done like for any other field type as described in Add Internationalization (i18n) To Document Types.
Legacy Taxonomy Mixin
A mixin-based taxonomy field in a document type can be translated using resource bundles. To change the name of the field, go to the CMS Console, navigate to the node
/hippo:configuration/hippo:translations/hippo:types/[project-namespace]:[document-type]/[language]
and add a property named hippotaxonomy:keys in which you can set the name of the field.
You can also use a generic name for all languages by navigating to the node
/hippo:namespaces/[project-namespace]/[document-type]/editor:templates/_default_/classifiable/cluster.options
and adding a property caption that will contain the field name. It is also possible to set this property through the document editor interface of the CMS (the same applies to the "hint" field)
This only applies to the default taxonomy field (using the hippotaxonomy:classifiable mixin), when using a secondary taxonomy on a document, please see this page.