Skip to content

Commit

Permalink
ignored unabled translation attributes which likes id/title/date/etc …
Browse files Browse the repository at this point in the history
…for translation functionality to folder content panel
  • Loading branch information
terapyon committed Feb 18, 2016
1 parent 6bfe33a commit 92e9749
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion plone/app/content/browser/vocabulary.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ def __call__(self):
if isinstance(attributes, basestring) and attributes:
attributes = attributes.split(',')

translate_ignored = [
'Creator', 'Date', 'Description', 'Title', 'author_name',
'cmf_uid', 'commentators', 'created', 'effective', 'end',
'expires', 'getIcon', 'getId', 'getRemoteUrl', 'in_response_to',
'listCreators', 'location', 'modified', 'start', 'sync_uid',
'path', 'getURL', 'EffectiveDate', 'getObjSize', 'id',
'UID', 'ExpirationDate', 'ModificationDate', 'CreationDate',
]
if attributes:
base_path = getNavigationRoot(context)
for vocab_item in results:
Expand All @@ -156,7 +164,10 @@ def __call__(self):
continue
if key == 'path':
val = val[len(base_path):]
item[key] = translate(_(safe_unicode(val)), context=self.request)
if key not in translate_ignored and isinstance(val, basestring):
item[key] = translate(_(safe_unicode(val)), context=self.request)
else:
item[key] = val
items.append(item)
else:
for item in results:
Expand Down

0 comments on commit 92e9749

Please sign in to comment.