Changeset 7959


Ignore:
Timestamp:
22 Mar 2012, 15:51:23 (13 years ago)
Author:
Henrik Bettermann
Message:

Translate all history messages.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/objecthistory.py

    r7819 r7959  
    6969            user = user.title
    7070        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    71         by = 'by'
    72         if portal_language != 'en':
    73             by = translate(_('by'),'waeup.kofa',target_language=portal_language)
    74             msg = translate(msg,'waeup.kofa',target_language=portal_language)
     71        by = translate(_('by'),'waeup.kofa',target_language=portal_language)
     72        msg = translate(msg,'waeup.kofa',target_language=portal_language)
    7573        msg = u'%s - %s %s %s' % (timestamp, msg, by, user)
    7674        msgs.append(msg)
  • main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py

    r7952 r7959  
    3535    IBatchProcessor, FatalCSVError, IObjectConverter, IUserAccount,
    3636    IObjectHistory, VALIDATED)
     37from waeup.kofa.interfaces import MessageFactory as _
    3738from waeup.kofa.students.interfaces import (
    3839    IStudent, IStudentStudyCourse,
     
    130131        return None
    131132
    132        
    133133    def addEntry(self, obj, row, site):
    134134        parent = self.getParent(row, site)
    135135        parent.addStudent(obj)
    136         # We don't need to log this because is already done by the workflow
    137         # transition even handler.
     136        # We have to log this if reg_state is provided. If not,
     137        # logging is done by the event handler handle_student_added
     138        if row.has_key('reg_state'):
     139            parent.logger.info('%s - Student record created' % obj.student_id)
    138140        history = IObjectHistory(obj)
    139         history.addMessage('Student record imported')
     141        history.addMessage(_('Student record created'))
    140142        return
    141143
     
    161163            elif key == 'reg_state':
    162164                IWorkflowState(obj).setState(value)
    163                 msg = "State '%s' set" % value
     165                msg = _("State '${a}' set", mapping = {'a':value})
    164166                history = IObjectHistory(obj)
    165167                history.addMessage(msg)
Note: See TracChangeset for help on using the changeset viewer.