Commit d4a95bc0 authored by Jérome Perrin's avatar Jérome Perrin

If we display translated category, use getTranslatedTitleOrId to show the base

category title.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21392 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cce2c720
...@@ -220,13 +220,21 @@ class Renderer(Filter): ...@@ -220,13 +220,21 @@ class Renderer(Filter):
label = url label = url
# Add base category in label # Add base category in label
if self.display_base_category: if self.display_base_category:
base_category_display_method_id = 'getTitleOrId'
# If we are asked a translated version, display translated title of the
# base category
if self.translate_display or (self.display_id and
'translated' in self.display_id.lower()):
base_category_display_method_id = 'getTranslatedTitleOrId'
if self.base_category: if self.base_category:
bc = value.portal_categories.resolveCategory(self.base_category) bc = value.portal_categories.resolveCategory(self.base_category)
label = '%s/%s' % (bc.getTitleOrId(), label) bc_title = getattr(bc, base_category_display_method_id)()
label = '%s/%s' % (bc_title, label)
else: else:
if getattr(value, 'getBaseCategoryValue', None) is not None: if getattr(value, 'getBaseCategoryValue', None) is not None:
bc = value.getBaseCategoryValue() bc = value.getBaseCategoryValue()
label = '%s/%s' % (bc.getTitleOrId(), label) bc_title = getattr(bc, base_category_display_method_id)()
label = '%s/%s' % (bc_title, label)
if self.is_right_display: if self.is_right_display:
item = [url, label] item = [url, label]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment