Commit 3460448c authored by Mame Coumba Sall's avatar Mame Coumba Sall

modified to translate workflow state titles with message id with and without context

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26076 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3a3be130
...@@ -108,8 +108,16 @@ class TranslatedTitleGetter(TitleGetter): ...@@ -108,8 +108,16 @@ class TranslatedTitleGetter(TitleGetter):
def __call__(self, instance): def __call__(self, instance):
portal_workflow = getToolByName(instance, 'portal_workflow') portal_workflow = getToolByName(instance, 'portal_workflow')
localizer = getToolByName(instance, 'Localizer') localizer = getToolByName(instance, 'Localizer')
wf = portal_workflow.getWorkflowById(self._key) wf_id = self._key
wf = portal_workflow.getWorkflowById(wf_id)
selected_language = localizer.get_selected_language()
state_title = wf._getWorkflowStateOf(instance).title state_title = wf._getWorkflowStateOf(instance).title
return localizer.erp5_ui.gettext(state_title).encode('utf8') msg_id = '%s [state in %s]' % (state_title, wf_id)
result = localizer.erp5_ui.gettext(msg_id,
lang=selected_language,default='')
if result == '':
result = localizer.erp5_ui.gettext(state_title,
lang=selected_language)
return result
psyco.bind(__call__) psyco.bind(__call__)
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