Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions plone/app/content/browser/contents/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ def get_options(self):
site_path = site.getPhysicalPath()
context_path = self.context.getPhysicalPath()
columns = self.get_columns()
columns['translated_review_state'] = translate(_('Review state'), context=self.request)

options = {
'vocabularyUrl': '%splone.app.vocabularies.Catalog' % (
base_vocabulary),
Expand Down
13 changes: 13 additions & 0 deletions plone/app/content/browser/vocabulary.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ class VocabLookupException(Exception):

class BaseVocabularyView(BrowserView):

@property
def wftool(self):
return getToolByName(self.context, 'portal_workflow')

def get_translated_ignored(self):
return TRANSLATED_IGNORED

Expand Down Expand Up @@ -263,6 +267,15 @@ def __call__(self):
"unknown.png",
]
)

if key == 'translated_review_state':
val = getattr(vocab_item, 'review_state', None)
title = self.wftool.getTitleForStateOnType(val, getattr(vocab_item, 'portal_type'))

if isinstance(title, six.binary_type):
title = title.decode("utf8")
item[key] = translate(title, domain='plone', context=self.request)

items.append(item)
else:
items = [{'id': item.value,
Expand Down