[Mpuls-commits] r5061 - base/trunk/mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Jun 3 12:00:06 CEST 2011


Author: ludwig
Date: 2011-06-03 12:00:05 +0200 (Fri, 03 Jun 2011)
New Revision: 5061

Modified:
   base/trunk/mpulsweb/controllers/document.py
   base/trunk/mpulsweb/controllers/evaluation_overview.py
Log:
Issue1005: Move translated msgs inline.
(evaluation_overview.py document.py)

Modified: base/trunk/mpulsweb/controllers/document.py
===================================================================
--- base/trunk/mpulsweb/controllers/document.py	2011-06-03 09:49:38 UTC (rev 5060)
+++ base/trunk/mpulsweb/controllers/document.py	2011-06-03 10:00:05 UTC (rev 5061)
@@ -40,26 +40,6 @@
 from mpulsweb.lib.validators import UploadGlobalDocumentForm
 from mpulsweb.model.document import Document, listDocuments, deleteDocument
 
-OK_TO_CONTINUE = _("Please click OK to continue.")
-
-SET_DOCUMENT_SUCCESS_HEADER = _(u"Document added!")
-SET_DOCUMENT_FAILED_HEADER  = _(u"No document added!")
-SET_DOCUMENT_FAILED_TEXT    = _(u"""Please make sure that the path is correct. Documents
-can be viewed directly via the "Browse" button""") + " " + OK_TO_CONTINUE
-
-SET_DOCUMENT_SUCCESS_DELETE_HEADER = _(u"Document deleted!")
-SET_DOCUMENT_CONFIRM_DELETE_HEADER = _(u"Delete document?")
-SET_DOCUMENT_CONFIRM_DELETE_TEXT   = _(u"Do you want to delete the document and irrevocably lose the data?")
-SET_ATTACHMENT_SUCCESS_HEADER      = _(u"Attachment added!")
-SET_ATTACHMENT_SUCCESS_TEXT        = OK_TO_CONTINUE
-SET_ATTACHMENT_FAILED_HEADER       = _(u"No attachment added!")
-SET_ATTACHMENT_FAILED_TEXT         = _(u"""Please make sure that the path is correct. Attachments
-can be viewed directly via the "Browse" button""") + " " + OK_TO_CONTINUE
-SET_ATTACHMENT_SUCCESS_DELETE_HEADER = _(u"Attachment deleted!""")
-SET_ATTACHMENT_SUCCESS_DELETE_TEXT   = OK_TO_CONTINUE
-SET_ATTACHMENT_CONFIRM_DELETE_HEADER = _(u"Delete attachment?")
-SET_ATTACHMENT_CONFIRM_DELETE_TEXT   = _(u"Do you want to irrevocably delete the attachment?")
-
 log = logging.getLogger(__name__)
 
 class DocumentController(BaseController):
@@ -92,8 +72,8 @@
             if result['name']:
                 filename = result['name']
             doc.create(filename, content)
-            c.dialog_title = SET_DOCUMENT_SUCCESS_HEADER
-            c.dialog_text = OK_TO_CONTINUE
+            c.dialog_title = _(u"Document added!")
+            c.dialog_text = _("Please click OK to continue.")
             c.url_ok = h.url_for(controller="document",
                                  action="globalOverview")
             return render('/documents/dialogs/success_documents.mako')
@@ -134,13 +114,13 @@
                 return self.globalOverview()
             c.url_ok = h.url_for(controller="/document",
                                  action="globalOverview")
-            c.dialog_title = SET_DOCUMENT_SUCCESS_DELETE_HEADER
-            c.dialog_text = OK_TO_CONTINUE
+            c.dialog_title = _(u"Document deleted!")
+            c.dialog_text =  _("Please click OK to continue.")
             return render('/documents/dialogs/delete_document_success.mako')
         else:
             c.context = "../main.mako"
-            c.dialog_title = SET_DOCUMENT_CONFIRM_DELETE_HEADER
-            c.dialog_text = SET_DOCUMENT_CONFIRM_DELETE_TEXT
+            c.dialog_title = _(u"Delete document?")
+            c.dialog_text = _(u"Do you want to delete the document and irrevocably lose the data?")
             c.url_yes = h.url_for(controller='/document',
                                   action='globalDelete', id=id, confirmed=1)
             c.url_no = h.url_for(controller='/document',

Modified: base/trunk/mpulsweb/controllers/evaluation_overview.py
===================================================================
--- base/trunk/mpulsweb/controllers/evaluation_overview.py	2011-06-03 09:49:38 UTC (rev 5060)
+++ base/trunk/mpulsweb/controllers/evaluation_overview.py	2011-06-03 10:00:05 UTC (rev 5061)
@@ -18,17 +18,6 @@
 
 log = logging.getLogger(__name__)
 
-BUNDLE_NOTIFICATION_NOACTION_HEADER = _("No action specified for the selection")
-BUNDLE_NOTIFICATION_NOACTION = _("""You have not selected any action for the
-selection. Please click OK to go to the case overview and select there
-an action from the drop down menu.""")
-
-BUNDLE_NOTIFICATION_EMPTYLIST_HEADER = _("No valid agencys in the selection!")
-BUNDLE_NOTIFICATION_EMPTYLIST = _(u"""The selected action can not be executed
-on any of the agencys in your selection. Please make sure that the agencys are
-in a state from which you can execute the selected action.""")
-
-
 def get_sort(params):
     '''Return sort field and sort order. First try to return a userdefined sort
     and order. If user does not provide one of there params, try to return the
@@ -180,13 +169,17 @@
 
     def _empty_caselist(self):
         c.url_ok = url_for(controller='/evaluation_overview')
-        c.dialog_title = BUNDLE_NOTIFICATION_EMPTYLIST_HEADER
-        c.dialog_text = BUNDLE_NOTIFICATION_EMPTYLIST
+        c.dialog_title = _("No valid agencys in the selection!")
+        c.dialog_text = _(u"""The selected action can not be executed
+on any of the agencys in your selection. Please make sure that the agencys are
+in a state from which you can execute the selected action.""")
         return render('/casebundle/dialogs/error.mako')
 
     def no_action(self):
-        c.dialog_title= BUNDLE_NOTIFICATION_NOACTION_HEADER
-        c.dialog_text = BUNDLE_NOTIFICATION_NOACTION
+        c.dialog_title= _("No action specified for the selection")
+        c.dialog_text = _("""You have not selected any action for the
+selection. Please click OK to go to the case overview and select there
+an action from the drop down menu.""")
         c.url_ok = url_for(controller='/evaluation_overview')
         return render('/casebundle/dialogs/error.mako')
 



More information about the Mpuls-commits mailing list