[Mpuls-commits] r5059 - in base/trunk: . mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Jun 3 11:26:09 CEST 2011


Author: ludwig
Date: 2011-06-03 11:26:08 +0200 (Fri, 03 Jun 2011)
New Revision: 5059

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/controllers/annotations.py
   base/trunk/mpulsweb/controllers/appointment.py
Log:
Issue1005: Move translated msgs inline.(annotations.py and appointment.py)


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2011-06-03 09:14:03 UTC (rev 5058)
+++ base/trunk/ChangeLog	2011-06-03 09:26:08 UTC (rev 5059)
@@ -1,5 +1,11 @@
 2011-06-03  Ludwig Reiter <ludwig.reiter at intevation.de>
 
+	* mpulsweb/controllers/annotations.py,
+	mpulsweb/controllers/appointment.py:
+	Issue1005: Move translated msgs inline.
+
+2011-06-03  Ludwig Reiter <ludwig.reiter at intevation.de>
+
 	* mpulsweb/controllers/administration.py:
 	Issue1005: Move translated msgs inline.
 

Modified: base/trunk/mpulsweb/controllers/annotations.py
===================================================================
--- base/trunk/mpulsweb/controllers/annotations.py	2011-06-03 09:14:03 UTC (rev 5058)
+++ base/trunk/mpulsweb/controllers/annotations.py	2011-06-03 09:26:08 UTC (rev 5059)
@@ -10,9 +10,6 @@
 
 log = logging.getLogger(__name__)
 
-DEFAULT_REQUIRED_TEXT = _('This field is a required field, and must be filled out')
-DEFAULT_EVALUATION_TEXT = _('This field is relevant for evaluation purpose')
-
 class AnnotationsController(BaseController):
 
     @checkRole(('admin_ka', 'cm_ka', 'pt_dlr'))
@@ -45,7 +42,8 @@
             abort(404, _('No help available'))
         c.annotation_header = _('Required field')
         c.annotation_title = nc.getDescription()
-        c.annotation_text = nc.getRequired() or DEFAULT_REQUIRED_TEXT 
+        c.annotation_text = nc.getRequired() or _('This field is a required'
+                ' field, and must be filled out')
         return render('/annotations/annotation.mako')
 
     @checkRole(('admin_ka', 'cm_ka', 'pt_dlr'))
@@ -56,5 +54,5 @@
         c.annotation_header = _('Evaluation relevant field')
         c.annotation_title = nc.getDescription()
         c.annotation_text = nc.getEvaluation() or \
-            DEFAULT_EVALUATION_TEXT
+            _('This field is relevant for evaluation purpose')
         return render('/annotations/annotation.mako')

Modified: base/trunk/mpulsweb/controllers/appointment.py
===================================================================
--- base/trunk/mpulsweb/controllers/appointment.py	2011-06-03 09:14:03 UTC (rev 5058)
+++ base/trunk/mpulsweb/controllers/appointment.py	2011-06-03 09:26:08 UTC (rev 5059)
@@ -45,21 +45,6 @@
 
 log = logging.getLogger(__name__)
 
-DELETE_APPOINT_CONFIRM = _(u'Delete appointment?')
-DELETE_APPOINT_CONFIRM_TEXT = _(u"""Do you really want to delete the appointment
-and irrevocably lose all the data?""")
-
-OK_TO_OVERVIEW = _("Please click OK to continue to the appointment overview")
-
-DELETE_APPOINT_NOTIFICATION_SUCCESS = _(u'Appointment deleted')
-DELETE_APPOINT_NOTIFICATION_TEXT_SUCCESS = _(u"The appointment was successfully deleted.") + " " + OK_TO_OVERVIEW
-
-CREATE_APPOINT_NOTIFICATION_SUCCESS = _(u"Appointment created")
-CREATE_APPOINT_NOTIFICATION_TEXT_SUCCESS = _(u"The appointment was successfully created.") + " " + OK_TO_OVERVIEW
-
-EDIT_APPOINT_NOTIFICATION_SUCCESS = _(u"Appointment edited")
-EDIT_APPOINT_NOTIFICATION_TEXT_SUCCESS = _(u"The appointment was successfully edited") + " " + OK_TO_OVERVIEW
-
 class AppointmentController(BaseController):
 
     @checkRole(('admin_ka', 'cm_ka', 'pt_dlr'))
@@ -95,8 +80,10 @@
             appointment = factory.createNew()
             appointment.setData(c.form_result)
             appointment.store()
-            c.dialog_title = CREATE_APPOINT_NOTIFICATION_SUCCESS
-            c.dialog_text = CREATE_APPOINT_NOTIFICATION_TEXT_SUCCESS
+            c.dialog_title = _(u'Appointment deleted')
+            c.dialog_text =  _(u"The appointment was successfully deleted.") + \
+                    " "  + \
+                    _("Please click OK to continue to the appointment overview")
             c.url_ok = url_for(controller='/appointment', action='overview')
             return render('/appointments/dialogs/success_create_appointment.mako')
         except formencode.Invalid, error:
@@ -147,8 +134,10 @@
             appointment = factory.loadById(form_result.get('id'))
             appointment.setData(form_result)
             appointment.store()
-            c.dialog_title = EDIT_APPOINT_NOTIFICATION_SUCCESS
-            c.dialog_text = EDIT_APPOINT_NOTIFICATION_TEXT_SUCCESS
+            c.dialog_title = _(u"Appointment edited")
+            c.dialog_text = _(u"The appointment was successfully edited") + \
+                    " " + \
+                    _("Please click OK to continue to the appointment overview")
             c.url_ok = url_for(controller='/appointment', action='overview')
             return render('/appointments/dialogs/success_edit_appointment.mako')
         except formencode.Invalid, error:
@@ -168,14 +157,17 @@
         if confirmed == 1:
             appointment = factory.loadById(id)
             appointment.delete()
-            c.dialog_title = DELETE_APPOINT_NOTIFICATION_SUCCESS
-            c.dialog_text = DELETE_APPOINT_NOTIFICATION_TEXT_SUCCESS
+            c.dialog_title = _(u'Appointment deleted')
+            c.dialog_text = _(u"The appointment was successfully deleted.") + \
+                   " " + \
+                   _("Please click OK to continue to the appointment overview")
             c.url_ok = url_for(controller='/appointment', action='overview')
             return render('/appointments/dialogs/success_delete_appointment.mako')
         else:
             c.context = "../main.mako"
-            c.dialog_title = DELETE_APPOINT_CONFIRM
-            c.dialog_text = DELETE_APPOINT_CONFIRM_TEXT
+            c.dialog_title = _(u'Delete appointment?')
+            c.dialog_text = _(u"Do you really want to delete the appointment"
+                              u"\nand irrevocably lose all the data?")
             c.url_yes = url_for(controller='/appointment', action='delete',
                                 id=id, confirmed=1)
             c.url_no = url_for(controller='/appointment', action='overview')



More information about the Mpuls-commits mailing list