Changeset 7687


Ignore:
Timestamp:
23 Feb 2012, 10:18:10 (13 years ago)
Author:
Henrik Bettermann
Message:

Translate transitions and history.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py

    r7685 r7687  
    4545    ISIRPObject, ILocalRolesAssignable, IExtFileStore, IPDF,
    4646    IFileStoreNameChooser, IPasswordValidator, IUserAccount, ISIRPUtils)
     47from waeup.sirp.interfaces import MessageFactory as _
    4748from waeup.sirp.permissions import get_users_with_local_roles
    4849from waeup.sirp.students.interfaces import IStudentsUtils
     
    648649        """
    649650        allowed_transitions = self.wf_info.getManualTransitions()
    650         return [dict(name='', title='No transition')] +[
     651        return [dict(name='', title=_('No transition'))] +[
    651652            dict(name=x, title=y) for x, y in allowed_transitions]
    652653
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/applicantdisplaypage.pt

    r7669 r7687  
    1 <h2> ... <span tal:replace="context/state">Application State</span> ... </h2>
     1<h2> ... <span tal:replace="context/translated_state">Application State</span> ... </h2>
    22
    33<div class="workflow">
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/applicanteditpage.pt

    r7669 r7687  
    22      enctype="multipart/form-data">
    33
    4   <h2> ... <span tal:replace="context/state">Application State</span> ... </h2>
     4  <h2> ... <span tal:replace="context/translated_state">Application State</span> ... </h2>
    55
    66  <div class="workflow">
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/workflow.py

    r7686 r7687  
    1919"""
    2020import grok
     21from zope.component import getUtility
     22from zope.i18n import translate
    2123from hurry.workflow.workflow import Transition, WorkflowState, NullCondition
    2224from hurry.workflow.interfaces import IWorkflowState, IWorkflowTransitionEvent
    2325from waeup.sirp.applicants.interfaces import IApplicantBaseData
    24 from waeup.sirp.interfaces import IObjectHistory, ISIRPWorkflowInfo
     26from waeup.sirp.interfaces import IObjectHistory, ISIRPWorkflowInfo, ISIRPUtils
    2527from waeup.sirp.interfaces import MessageFactory as _
    2628from waeup.sirp.workflow import SIRPWorkflow, SIRPWorkflowInfo
     
    4850    Transition(
    4951        transition_id = 'init',
    50         title = 'Initialize application',
     52        title = _('Initialize application'),
    5153        source = None,
    5254        condition = NullCondition,
    53         msg = 'Application initialized',
     55        msg = _('Application initialized'),
    5456        destination = INITIALIZED),
    5557
    5658    Transition(
    5759        transition_id = 'start',
    58         title = 'Start application',
    59         msg = 'Application started',
     60        title = _('Start application'),
     61        msg = _('Application started'),
    6062        source = INITIALIZED,
    6163        destination = STARTED),
     
    6365    Transition(
    6466        transition_id = 'pay',
    65         title = 'Pay acceptance fee',
    66         msg = 'Fee paid',
     67        title = _('Pay acceptance fee'),
     68        msg = _('Fee paid'),
    6769        source = STARTED,
    6870        destination = PAID),
     
    7072    Transition(
    7173        transition_id = 'submit',
    72         title = 'Submit application',
    73         msg = 'Application submitted',
     74        title = _('Submit application'),
     75        msg = _('Application submitted'),
    7476        source = PAID,
    7577        destination = SUBMITTED),
     
    7779    Transition(
    7880        transition_id = 'admit',
    79         title = 'Admit applicant',
    80         msg = 'Applicant admitted',
     81        title = _('Admit applicant'),
     82        msg = _('Applicant admitted'),
    8183        source = SUBMITTED,
    8284        destination = ADMITTED),
     
    8486    Transition(
    8587        transition_id = 'refuse1',
    86         title = 'Refuse application',
    87         msg = 'Application refused',
     88        title = _('Refuse application'),
     89        msg = _('Application refused'),
    8890        source = SUBMITTED,
    8991        destination = NOT_ADMITTED),
     
    9193    Transition(
    9294        transition_id = 'refuse2',
    93         title = 'Refuse application',
    94         msg = 'Application refused',
     95        title = _('Refuse application'),
     96        msg = _('Application refused'),
    9597        source = ADMITTED,
    9698        destination = NOT_ADMITTED),
     
    98100    Transition(
    99101        transition_id = 'create',
    100         title = 'Create student record',
    101         msg = 'Student record created',
     102        title = _('Create student record'),
     103        msg = _('Student record created'),
    102104        source = ADMITTED,
    103105        destination = CREATED),
     
    105107    Transition(
    106108        transition_id = 'reset1',
    107         title = 'Reset application to started',
    108         msg = 'Application reset',
     109        title = _('Reset application to started'),
     110        msg = _('Application reset'),
    109111        source = SUBMITTED,
    110112        destination = STARTED),
     
    112114    Transition(
    113115        transition_id = 'reset2',
    114         title = 'Reset application to started',
    115         msg = 'Application reset',
     116        title = _('Reset application to started'),
     117        msg = _('Application reset'),
    116118        source = ADMITTED,
    117119        destination = STARTED),
     
    119121    Transition(
    120122        transition_id = 'reset3',
    121         title = 'Reset application to started',
    122         msg = 'Application reset',
     123        title = _('Reset application to started'),
     124        msg = _('Application reset'),
    123125        source = NOT_ADMITTED,
    124126        destination = STARTED),
     
    126128    Transition(
    127129        transition_id = 'reset4',
    128         title = 'Reset application to started',
    129         msg = 'Application reset',
     130        title = _('Reset application to started'),
     131        msg = _('Application reset'),
    130132        source = CREATED,
    131133        destination = STARTED),
    132134    Transition(
    133135        transition_id = 'reset5',
    134         title = 'Reset application to paid',
    135         msg = 'Application reset',
     136        title = _('Reset application to paid'),
     137        msg = _('Application reset'),
    136138        source = SUBMITTED,
    137139        destination = PAID),
     
    163165    """Append message to applicant history when transition happened.
    164166    """
    165     msg = '%s' % event.transition.user_data['msg']
     167    msg = event.transition.user_data['msg']
     168    portal_language = getUtility(ISIRPUtils).PORTAL_LANGUAGE
     169    if portal_language != 'en':
     170        msg = translate(msg,'waeup.sirp',target_language=portal_language)
    166171    history = IObjectHistory(obj)
    167172    history.addMessage(msg)
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py

    r7681 r7687  
    4141    ISIRPObject, IUserAccount, IExtFileStore, IPasswordValidator, IContactForm,
    4242    ISIRPUtils, IUniversity)
     43from waeup.sirp.interfaces import MessageFactory as _
    4344from waeup.sirp.widgets.datewidget import (
    4445    FriendlyDateWidget, FriendlyDateDisplayWidget,
     
    341342        """
    342343        allowed_transitions = self.wf_info.getManualTransitions()
    343         return [dict(name='', title='No transition')] +[
     344        return [dict(name='', title=_('No transition'))] +[
    344345            dict(name=x, title=y) for x, y in allowed_transitions]
    345346
Note: See TracChangeset for help on using the changeset viewer.