[workflow view] Display a non-localized version of state/transition names (closes #1912537). stable
authorDamien Garaud <damien.garaud@logilab.fr>
Fri, 10 Feb 2012 16:22:38 +0100
branchstable
changeset 8212 a045d3821990
parent 8209 67660d5f1916
child 8213 076c80543fcd
[workflow view] Display a non-localized version of state/transition names (closes #1912537).
entities/wfobjs.py
web/views/dotgraphview.py
--- a/entities/wfobjs.py	Thu Feb 09 09:52:02 2012 +0100
+++ b/entities/wfobjs.py	Fri Feb 10 16:22:38 2012 +0100
@@ -256,6 +256,9 @@
     """customized class for Transition entities"""
     __regid__ = 'Transition'
 
+    def dc_long_title(self):
+        return '%s (%s)' % (self.name, self._cw._(self.name))
+
     def destination(self, entity):
         try:
             return self.destination_state[0]
@@ -345,6 +348,9 @@
     fetch_attrs, cw_fetch_order = fetch_config(['name'])
     rest_attr = 'eid'
 
+    def dc_long_title(self):
+        return '%s (%s)' % (self.name, self._cw._(self.name))
+
     @property
     def workflow(self):
         # take care, may be missing in multi-sources configuration
--- a/web/views/dotgraphview.py	Thu Feb 09 09:52:02 2012 +0100
+++ b/web/views/dotgraphview.py	Fri Feb 10 16:22:38 2012 +0100
@@ -71,7 +71,7 @@
 
     def node_properties(self, entity):
         """return default DOT drawing options for a state or transition"""
-        return {'label': entity.dc_title(),
+        return {'label': entity.dc_long_title(),
                 'href': entity.absolute_url(),
                 'fontname': 'Courier', 'fontsize': 10, 'shape':'box',
                  }