Changeset 7679 for main/waeup.sirp


Ignore:
Timestamp:
22 Feb 2012, 11:38:41 (13 years ago)
Author:
Henrik Bettermann
Message:

Translate student workflow history messages.

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  
    1919from datetime import datetime
    2020from persistent.list import PersistentList
     21from zope.component import getUtility
     22from zope.i18n import translate
    2123from zope.annotation.interfaces import IAnnotations
    22 from waeup.sirp.interfaces import IObjectHistory, ISIRPObject
     24from waeup.sirp.interfaces import IObjectHistory, ISIRPObject, ISIRPUtils
    2325from waeup.sirp.utils.helpers import get_current_principal
     26
     27from waeup.sirp.interfaces import MessageFactory as _
    2428
    2529class ObjectHistory(grok.Adapter):
     
    6468        else:
    6569            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)
    6775        msgs.append(msg)
    6876        self._annotations[self.history_key] = msgs
  • main/waeup.sirp/trunk/src/waeup/sirp/students/workflow.py

    r7677 r7679  
    33import grok
    44from zope.component import getUtility
     5from zope.i18n import translate
    56from hurry.workflow.workflow import Transition, WorkflowState, NullCondition
    67from hurry.workflow.interfaces import IWorkflowState, IWorkflowTransitionEvent
    78from waeup.sirp.interfaces import (
    8     IObjectHistory, ISIRPWorkflowInfo,
     9    IObjectHistory, ISIRPWorkflowInfo, ISIRPUtils,
    910    CREATED, ADMITTED, CLEARANCE, REQUESTED, CLEARED, PAID, RETURNING,
    1011    REGISTERED, VALIDATED)
     
    183184      Lock and unlock clearance form.
    184185    """
    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)
    186191    history = IObjectHistory(obj)
    187192    history.addMessage(msg)
Note: See TracChangeset for help on using the changeset viewer.