Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
14.7.5
-
Flagged
-
Client Service Team
Description
When a taxonomy field is configured in a compound, the tree labels in the taxonomy picker are in the user locale, not in document locale, like is the case when configured on document level.
Analysis: the method org.onehippo.taxonomy.plugin.TaxonomyPickerPlugin#getPreferredLocale looks at document level only.
/** * Returns the translation locale of the document if exists. * Otherwise, returns the user's UI locale as a fallback. */ protected Locale getPreferredLocale() { final Node node = getModel().getObject(); try { if (node.isNodeType(HippoTranslationNodeType.NT_TRANSLATED) && node.hasProperty(HippoTranslationNodeType.LOCALE)) { return TaxonomyUtil.toLocale(node.getProperty(HippoTranslationNodeType.LOCALE).getString()); } } catch (final RepositoryException e) { log.error("Failed to detect " + HippoTranslationNodeType.LOCALE + " to choose the preferred locale", e); } return getLocale(); }
Set up:
Create a compound, add hippotaxonomy:classifiable in its nodetype namespace
/hippo:namespaces/myproject/mycompound/hipposysedit:nodetype/hipposysedit:nodetype hipposysedit:supertype: ['hippo:compound', 'hippostd:relaxed', 'hippotaxonomy:classifiable']
And add an editor field:
/hippo:namespaces/myproject/mycompound/editor:templates/_default_/classifiable jcr:primaryType: frontend:plugin mixin: hippotaxonomy:classifiable plugin.class: org.hippoecm.frontend.editor.plugins.mixin.MixinLoaderPlugin wicket.id: ${cluster.id}.field /cluster.options: jcr:primaryType: frontend:pluginconfig taxonomy.name: mytree
Then create a non-English content tree with the same non-English taxonomy item labels.