[Mpuls-commits] r5064 - in wasko/trunk: . waskoweb/controllers

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


Author: ludwig
Date: 2011-06-03 12:52:15 +0200 (Fri, 03 Jun 2011)
New Revision: 5064

Modified:
   wasko/trunk/ChangeLog
   wasko/trunk/waskoweb/controllers/caselifetime.py
   wasko/trunk/waskoweb/controllers/settings.py
Log:
Issue1005: Move translated msgs inline.
(caselifetime.py settings.py)

Modified: wasko/trunk/ChangeLog
===================================================================
--- wasko/trunk/ChangeLog	2011-06-03 10:15:24 UTC (rev 5063)
+++ wasko/trunk/ChangeLog	2011-06-03 10:52:15 UTC (rev 5064)
@@ -1,3 +1,9 @@
+2011-06-03  Ludwig Reiter <ludwig.reiter at intevation.de>
+
+	* waskoweb/controllers/caselifetime.py,
+	waskoweb/controllers/settings.py:
+	Issue1005: Move translated msgs inline.
+
 2011-06-01  Ludwig Reiter <ludwig.reiter at intevation.de>
 
 	* waskoweb/public/formed/formedtree.xml:

Modified: wasko/trunk/waskoweb/controllers/caselifetime.py
===================================================================
--- wasko/trunk/waskoweb/controllers/caselifetime.py	2011-06-03 10:15:24 UTC (rev 5063)
+++ wasko/trunk/waskoweb/controllers/caselifetime.py	2011-06-03 10:52:15 UTC (rev 5064)
@@ -27,72 +27,6 @@
 log = logging.getLogger(__name__)
 
 
-REOPENOK_1_HEADER_CONFIRM = _(u"Reopen case?")
-REOPENOK_1_TEXT_CONFIRM = _(u"""\
-Do you want to reopen the case? Then the current case document will be
-anonymized and important parts of the case document copied from phase A and
-phase B in the new case document. You will work with the new case document.""")
-
-REOPENOK_2_HEADER_CONFIRM = _(u"Do you want to reopen the case for 3 months?")
-REOPENOK_2_TEXT_CONFIRM = _(u"""\
-Do you want to reopen the case for 3 months? You can edit the case document
-again.""")
-REOPENNOTOK_HEADER_CONFIRM = \
-_(u"Do you want to document not accepted reopening?")
-REOPENNOTOK_TEXT_CONFIRM = _(u"""\
-You have entered, that no acceptence is available. \
-If you continue, reopening, extension or addition will not be possible.""")
-
-REOPENOK_1_SUCCESS_HEADER = _(u"Case document successfully reopened.")
-REOPENOK_1_SUCCESS_TEXT = _(u'''\
-The case document has been successfully reopened. Click on OK to open the
-reopened case document.''')
-
-REOPENOK_2_SUCCESS_HEADER = _(u"Case document successfully reopened.")
-REOPENOK_2_SUCCESS_TEXT = _(u'''\
-The case document has been successfully reopened. Click on OK to get to the
-entry documentation of the case document.''')
-
-REOPENNOTOK_SUCCESS_HEADER = _(u"Not accepted reopening documented.")
-REOPENNOTOK_SUCCESS_TEXT = _(u'''\
-The not accepted reopening was documented. Click on OK to get to the
-entry documentation of the case document.''')
-
-RENEW_2_HEADER_CONFIRM =\
-_(u"Do you want to document the not accepted new subscription?")
-RENEW_2_TEXT_CONFIRM = _(u"""\
-You entered, that no acceptence of the new subscription is available.
-If you continue, no new addition of this case will be possible.""")
-
-RENEW_2_SUCCESS_HEADER = _(u"Not accepted new subscription documented.")
-RENEW_2_SUCCESS_TEXT = _(u'''\
-The not accepted new subscription was documented. Click on OK to get to the
-entry documentation of the case document.''')
-
-RENEW_HEADER_CONFIRM = _(u"Do you want to renew the case?")
-RENEW_TEXT_CONFIRM = _(u"""\
-Do you want to renew the case? Then the current case document will be
-anonymized and important parts of phase A and phase B will be copied into a
-new case document. You will work on the new case document then.""")
-
-RENEW_SUCCESS_HEADER = _(u"The case document was renewed.")
-RENEW_SUCCESS_TEXT = _(u'''\
-The case document was renewed. Click on OK to open the new case document.
-Please check the data and update them, if needed. The old case document
-was given to the administration for Anonymizing.''')
-
-ABORT_SUCCESS_HEADER = _(u'Entry documentation aborted.')
-ABORT_SUCCESS_TEXT = _(u'''\
-The entry documentation was successfully aborted. The case document was given
-to the administration for deletion. Click on OK to get back to the
-case documents overview.''')
-
-ABORT_TEXT_CONFIRM = _(u'''\
-Do you really want to abort the entry documentation and free the case document
-for deletion? The case document will not be editable then and will be given to
-the administration for seletion.''')
-ABORT_HEADER_CONFIRM = _(u'Do you want to abort the entry documentation?')
-
 # items not to be copied from old case for "neuaufnahme" and
 # "wiederaufnahme"
 # erstgespraech, datum_cm_start are relevant for both.
@@ -356,13 +290,20 @@
             # mark case for deletion
             case = g.case_factory.loadById(id)
             case.setState(3)
-            c.success_for = ABORT_SUCCESS_HEADER
-            c.success_text = ABORT_SUCCESS_TEXT
+            c.success_for = _(u'Entry documentation aborted.')
+            c.success_text =  _(u'''\
+The entry documentation was successfully aborted. The case document was given
+to the administration for deletion. Click on OK to get back to the
+case documents overview.''')
             c.url_ok = h.url_for(controller="/case_overview")
             return render('caselifetime/dialogs/success_reopen.mako')
         else:
-            c.confirm_for = ABORT_HEADER_CONFIRM
-            c.question = ABORT_TEXT_CONFIRM
+            c.confirm_for = _(u'Do you want to abort the entry documentation?')
+            c.question = _(u'''\
+Do you really want to abort the entry documentation and free the case document
+for deletion? The case document will not be editable then and will be given to
+the administration for seletion.''')
+
             c.url_yes = "/caselifetime/abortcase/%s/1" % id
             c.url_no = "/caselifetime/index/%s" % id
             return render('caselifetime/dialogs/confirm_reopen.mako')
@@ -452,13 +393,19 @@
             except Exception, err:
                 traceback.print_exc(file=sys.stderr)
 
-            c.success_for = RENEW_SUCCESS_HEADER
-            c.success_text = RENEW_SUCCESS_TEXT
+            c.success_for = _(u"The case document was renewed.")
+            c.success_text =  _(u'''\
+The case document was renewed. Click on OK to open the new case document.
+Please check the data and update them, if needed. The old case document
+was given to the administration for Anonymizing.''')
             c.url_ok = h.url_for(controller="/case/select/%s" % new_id)
             return render('caselifetime/dialogs/success_reopen.mako')
         else:
-            c.confirm_for = RENEW_HEADER_CONFIRM
-            c.question = RENEW_TEXT_CONFIRM
+            c.confirm_for = _(u"Do you want to renew the case?")
+            c.question = _(u"""\
+Do you want to renew the case? Then the current case document will be
+anonymized and important parts of phase A and phase B will be copied into a
+new case document. You will work on the new case document then.""")
             c.url_yes = "/caselifetime/renew_ok/%s/1" % id
             c.url_no = "/caselifetime/index/%s" % id
             return render('caselifetime/dialogs/confirm_reopen.mako')
@@ -476,15 +423,19 @@
             except Exception, err:
                 log.exception('Error in renew_notok')
 
-            c.success_for = RENEW_2_SUCCESS_HEADER
-            c.success_text = RENEW_2_SUCCESS_TEXT
+            c.success_for = _(u"Not accepted new subscription documented.")
+            c.success_text = _(u'''\
+The not accepted new subscription was documented. Click on OK to get to the
+entry documentation of the case document.''')
             c.url_ok = h.url_for(controller="formularpage",
                                  action="select",
                                  id="page-0:%s" % id)
             return render('caselifetime/dialogs/success_reopen.mako')
         else:
-            c.confirm_for = RENEW_2_HEADER_CONFIRM
-            c.question = RENEW_2_TEXT_CONFIRM
+            c.confirm_for = _(u"Do you want to document the not accepted new subscription?")
+            c.question =  _(u"""\
+You entered, that no acceptence of the new subscription is available.
+If you continue, no new addition of this case will be possible.""")
             c.url_yes = "/caselifetime/renew_notok/%s/1" % id
             c.url_no = "/caselifetime/index/%s" % id
             return render('caselifetime/dialogs/confirm_reopen.mako')
@@ -557,27 +508,36 @@
                 log.exception(err.__dict__)
             if c.num_wiederaufnahme < 1:
                 id = new_it.getRootNode().getIdentifier()
-                c.success_for = REOPENOK_1_SUCCESS_HEADER
-                c.success_text = REOPENOK_1_SUCCESS_TEXT
+                c.success_for = _(u"Case document successfully reopened.")
+                c.success_text = _(u'''\
+The case document has been successfully reopened. Click on OK to open the
+reopened case document.''')
                 c.url_ok = h.url_for(controller="/case",
                                      action="select",
                                      id="%s" % id)
             else:
-                c.success_for = REOPENOK_2_SUCCESS_HEADER
-                c.success_text = REOPENOK_2_SUCCESS_TEXT
+                c.success_for = _(u"Case document successfully reopened.")
+                c.success_text = _(u'''\
+The case document has been successfully reopened. Click on OK to get to the
+entry documentation of the case document.''')
                 c.url_ok = h.url_for(controller="/formularpage",
                                      action="select",
                                      id="page-0:%s" % id)
             return render('caselifetime/dialogs/success_reopen.mako')
         else:
             if c.num_wiederaufnahme < 1:
-                c.confirm_for = REOPENOK_1_HEADER_CONFIRM
-                c.question = REOPENOK_1_TEXT_CONFIRM
+                c.confirm_for = _(u"Reopen case?")
+                c.question = _(u"""\
+Do you want to reopen the case? Then the current case document will be
+anonymized and important parts of the case document copied from phase A and
+phase B in the new case document. You will work with the new case document.""")
                 c.url_yes = "/caselifetime/reopen_ok/%s/1" % id
                 c.url_no = "/caselifetime/index/%s" % id
             else:
-                c.confirm_for = REOPENOK_2_HEADER_CONFIRM
-                c.question = REOPENOK_2_TEXT_CONFIRM
+                c.confirm_for = _(u"Do you want to reopen the case for 3 months?")
+                c.question = _(u"""\
+Do you want to reopen the case for 3 months? You can edit the case document
+again.""")
                 c.url_yes = "/caselifetime/reopen_ok/%s/1" % id
                 c.url_no = "/caselifetime/index/%s" %id
             return render('caselifetime/dialogs/confirm_reopen.mako')
@@ -599,16 +559,20 @@
             except Exception, err:
                 print err
 
-            c.success_for = REOPENNOTOK_SUCCESS_HEADER
-            c.success_text = REOPENNOTOK_SUCCESS_TEXT
+            c.success_for = _(u"Not accepted reopening documented.")
+            c.success_text = _(u'''\
+The not accepted reopening was documented. Click on OK to get to the
+entry documentation of the case document.''')
             c.url_ok = h.url_for(controller="/formularpage",
                                  action="select",
                                  id="page-0:%s" % id)
             return render('caselifetime/dialogs/success_reopen.mako')
             return self.index()
         else:
-            c.confirm_for = REOPENNOTOK_HEADER_CONFIRM
-            c.question = REOPENNOTOK_TEXT_CONFIRM
+            c.confirm_for = _(u"Do you want to document not accepted reopening?")
+            c.question =  _(u"""\
+You have entered, that no acceptence is available. \
+If you continue, reopening, extension or addition will not be possible.""")
             c.url_yes = "/caselifetime/reopen_notok/%s/1" % id
             c.url_no = "/caselifetime/index/%s" % id
             return render('caselifetime/dialogs/confirm_reopen.mako')

Modified: wasko/trunk/waskoweb/controllers/settings.py
===================================================================
--- wasko/trunk/waskoweb/controllers/settings.py	2011-06-03 10:15:24 UTC (rev 5063)
+++ wasko/trunk/waskoweb/controllers/settings.py	2011-06-03 10:52:15 UTC (rev 5064)
@@ -17,11 +17,6 @@
 log = logging.getLogger(__name__)
 
 
-EDIT_AGENCY_SUCCESS_HEADER = _('Configurations saved!')
-EDIT_AGENCY_SUCCESS_TEXT = _('Please click on ok to continue.')
-
-
-
 class SettingsController(SettingsController):
     """
     Overwrite the Settings controller to use the wasko agency-settings model
@@ -53,7 +48,7 @@
             return render('/settings/edit.mako')
 
         c.agency.store(c.form_result)
-        c.dialog_title = EDIT_AGENCY_SUCCESS_HEADER
-        c.dialog_text = EDIT_AGENCY_SUCCESS_TEXT
+        c.dialog_title = _('Configurations saved!')
+        c.dialog_text = _('Please click on ok to continue.')
         c.url_ok = url_for(controller='/settings')
-        return render ('/settings/dialogs/success_edit.mako')
\ No newline at end of file
+        return render ('/settings/dialogs/success_edit.mako')



More information about the Mpuls-commits mailing list