Changeset 7679 for main/waeup.sirp
- Timestamp:
- 22 Feb 2012, 11:38:41 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/objecthistory.py
r7371 r7679 19 19 from datetime import datetime 20 20 from persistent.list import PersistentList 21 from zope.component import getUtility 22 from zope.i18n import translate 21 23 from zope.annotation.interfaces import IAnnotations 22 from waeup.sirp.interfaces import IObjectHistory, ISIRPObject 24 from waeup.sirp.interfaces import IObjectHistory, ISIRPObject, ISIRPUtils 23 25 from waeup.sirp.utils.helpers import get_current_principal 26 27 from waeup.sirp.interfaces import MessageFactory as _ 24 28 25 29 class ObjectHistory(grok.Adapter): … … 64 68 else: 65 69 user = user.title 66 msg = '%s - %s by %s' % (timestamp, msg, user) 70 portal_language = getUtility(ISIRPUtils).PORTAL_LANGUAGE 71 by = 'by' 72 if portal_language != 'en': 73 by = translate(_('by'),'waeup.sirp',target_language=portal_language) 74 msg = '%s - %s %s %s' % (timestamp, msg, by, user) 67 75 msgs.append(msg) 68 76 self._annotations[self.history_key] = msgs -
main/waeup.sirp/trunk/src/waeup/sirp/students/workflow.py
r7677 r7679 3 3 import grok 4 4 from zope.component import getUtility 5 from zope.i18n import translate 5 6 from hurry.workflow.workflow import Transition, WorkflowState, NullCondition 6 7 from hurry.workflow.interfaces import IWorkflowState, IWorkflowTransitionEvent 7 8 from waeup.sirp.interfaces import ( 8 IObjectHistory, ISIRPWorkflowInfo, 9 IObjectHistory, ISIRPWorkflowInfo, ISIRPUtils, 9 10 CREATED, ADMITTED, CLEARANCE, REQUESTED, CLEARED, PAID, RETURNING, 10 11 REGISTERED, VALIDATED) … … 183 184 Lock and unlock clearance form. 184 185 """ 185 msg = '%s' % event.transition.user_data['msg'] 186 187 msg = event.transition.user_data['msg'] 188 portal_language = getUtility(ISIRPUtils).PORTAL_LANGUAGE 189 if portal_language != 'en': 190 msg = translate(msg,'waeup.sirp',target_language=portal_language) 186 191 history = IObjectHistory(obj) 187 192 history.addMessage(msg)
Note: See TracChangeset for help on using the changeset viewer.