[Mpuls-commits] r2493 - in wasko/branches/2.0: . mpulsweb/controllers mpulsweb/i18n mpulsweb/i18n/de/LC_MESSAGES mpulsweb/templates/casemanagement

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Apr 22 15:36:57 CEST 2010


Author: roland
Date: 2010-04-22 15:36:54 +0200 (Thu, 22 Apr 2010)
New Revision: 2493

Modified:
   wasko/branches/2.0/ChangeLog
   wasko/branches/2.0/mpulsweb/controllers/case_bundle.py
   wasko/branches/2.0/mpulsweb/i18n/de/LC_MESSAGES/mpulsweb.po
   wasko/branches/2.0/mpulsweb/i18n/mpulsweb.pot
   wasko/branches/2.0/mpulsweb/templates/casemanagement/overview.mako
Log:
Wald issue #1427: handle plural forms in gettext

Modified: wasko/branches/2.0/ChangeLog
===================================================================
--- wasko/branches/2.0/ChangeLog	2010-04-22 13:24:38 UTC (rev 2492)
+++ wasko/branches/2.0/ChangeLog	2010-04-22 13:36:54 UTC (rev 2493)
@@ -33,6 +33,11 @@
 	printer friendly page
 	* mpulsweb/lib/renderer.py: Wald issue #1450: Improved readability of
 	warnings and errors
+	* mpulsweb/i18n/mpulsweb.pot:
+	* mpulsweb/i18n/de/LC_MESSAGES/mpulsweb.po:
+	* mpulsweb/controllers/case_bundle.py:
+	* mpulsweb/templates/casemanagement/overview.mako: Wald issue #1427: handle
+	plural forms in gettext
 
 
 2010-04-21  Torsten Irländer <torsten.irlaender at intevation.de>

Modified: wasko/branches/2.0/mpulsweb/controllers/case_bundle.py
===================================================================
--- wasko/branches/2.0/mpulsweb/controllers/case_bundle.py	2010-04-22 13:24:38 UTC (rev 2492)
+++ wasko/branches/2.0/mpulsweb/controllers/case_bundle.py	2010-04-22 13:36:54 UTC (rev 2493)
@@ -5,6 +5,7 @@
 import formencode
 
 from pylons import app_globals as g
+from pylons.i18n import _, ungettext
 
 from mpulsweb.lib.base import c, render, request, session, BaseController
 from mpulsweb.lib.security import checkRole
@@ -59,10 +60,9 @@
 werden.%s"""
 MARKANONYMIZE_SUCCESS_HEADER = u"""\
 Fallakte wurde zur Anonymisierung freigegeben!"""
-MARKANONYMIZE_SUCCESS_TEXT = u"""\
-Es wurden %s Fallakten zur Anonymisierung freigegeben. Sie liegen der
-Administration zur endgültigen Anonymisierung vor. Bitte klicken Sie auf "Ok",
-um fortzufahren."""
+
+OK_TO_CONTINUE = _("Please click OK to continue.")
+
 ANONYMIZE_SUCCESS_HEADER = u"""Fallakten anonymisiert!"""
 ANONYMIZE_SUCCESS_TEXT = u"""\
 Es wurden %s Fallakten erfolgreich anonymisiert. Bitte klicken Sie auf "Ok",
@@ -329,6 +329,12 @@
         if confirmed == 1:
             num = case_bundle.markAnonymize()
             c.success_for = MARKANONYMIZE_SUCCESS_HEADER
+            
+            MARKANONYMIZE_SUCCESS_TEXT = ungettext(u"""%s case was cleared for anonymisation. It will be presented to the administrators
+for review for the definite anonymisation.""",
+u"""%s cases were cleared for anonymisation. They will be presented to the administrators
+for review for the definite anonymisation.""", num) + " " + OK_TO_CONTINUE
+            
             c.success_text = MARKANONYMIZE_SUCCESS_TEXT % str(num)
             c.url_ok = "/case_overview"
             del session['casebundle']

Modified: wasko/branches/2.0/mpulsweb/i18n/de/LC_MESSAGES/mpulsweb.po
===================================================================
--- wasko/branches/2.0/mpulsweb/i18n/de/LC_MESSAGES/mpulsweb.po	2010-04-22 13:24:38 UTC (rev 2492)
+++ wasko/branches/2.0/mpulsweb/i18n/de/LC_MESSAGES/mpulsweb.po	2010-04-22 13:36:54 UTC (rev 2493)
@@ -225,6 +225,23 @@
 "Die maximale Aufbewahrungsdauer wurde erfolgreich verlängert. Bitte "
 "klicken Sie auf \"OK\", um fortzufahren."
 
+#: mpulsweb/controllers/case_bundle.py:64
+msgid "Please click OK to continue."
+msgstr "Bitte klicken Sie auf OK, um fortzufahren."
+
+#: mpulsweb/controllers/case_bundle.py:333
+#, python-format
+msgid ""
+"%s case was cleared for anonymisation. It will be presented to the administrators\n"
+"for review for the definite anonymisation."
+msgid_plural ""
+"%s cases were cleared for anonymisation. They will be presented to the administrators\n"
+"for review for the definite anonymisation."
+msgstr[0] "Es wurde %s Fallakte zur Anonymisierung freigegeben. Sie liegt der Administration zur endgültigen Anonymisierung vor."
+msgstr[1] "Es wurden %s Fallakten zur Anonymisierung freigegeben. Sie liegen der Administration zur endgültigen Anonymisierung vor."
+
+#: mpulsweb/controllers/evaluate.py:106
+#: mpulsweb/controllers/evaluate.py:225
 #: mpulsweb/controllers/evaluate.py:106 mpulsweb/controllers/evaluate.py:225
 msgid "Error: Evaluation failed"
 msgstr "Fehler: Auswertung fehlgeschlagen"
@@ -1697,6 +1714,22 @@
 msgid "cm_overview_con_list_dossiers_cm"
 msgstr "Hier wird eine Auflistung der Fälle des angemeldeten Benutzers angezeigt"
 
+#: mpulsweb/templates/casemanagement/overview.mako:18
+#, python-format
+msgid "%s case was found."
+msgid_plural "%s cases where found."
+msgstr[0] "Es wurde %s Akte gefunden."
+msgstr[1] "Es wurden %s Akten gefunden."
+
+#: mpulsweb/templates/casemanagement/overview.mako:25
+#, python-format
+#| msgid "Select all %s found cases."
+#| msgid_plural "Select the %s found case"
+msgid "Select the %s found case."
+msgid_plural "Select all %s found cases"
+msgstr[0] "Die angezeigte Fallakte (%s) auswählen"
+msgstr[1] "Alle angezeigten Fallakten (%s) auswählen"
+
 #: mpulsweb/templates/casemanagement/search.mako:8
 msgid "Search"
 msgstr "Suche"

Modified: wasko/branches/2.0/mpulsweb/i18n/mpulsweb.pot
===================================================================
--- wasko/branches/2.0/mpulsweb/i18n/mpulsweb.pot	2010-04-22 13:24:38 UTC (rev 2492)
+++ wasko/branches/2.0/mpulsweb/i18n/mpulsweb.pot	2010-04-22 13:36:54 UTC (rev 2493)
@@ -178,6 +178,23 @@
 msgid "Please click on \"OK\" to continue"
 msgstr ""
 
+#: mpulsweb/controllers/case_bundle.py:64
+msgid "Please click OK to continue."
+msgstr ""
+
+#: mpulsweb/controllers/case_bundle.py:333
+#, python-format
+msgid ""
+"%s case was cleared for anonymisation. It will be presented to the "
+"administrators\n"
+"for review for the definite anonymisation."
+msgid_plural ""
+"%s cases were cleared for anonymisation. They will be presented to the "
+"administrators\n"
+"for review for the definite anonymisation."
+msgstr[0] ""
+msgstr[1] ""
+
 #: mpulsweb/controllers/evaluate.py:106 mpulsweb/controllers/evaluate.py:225
 msgid "Error: Evaluation failed"
 msgstr ""
@@ -1619,6 +1636,20 @@
 msgid "cm_overview_con_list_dossiers_cm"
 msgstr ""
 
+#: mpulsweb/templates/casemanagement/overview.mako:18
+#, python-format
+msgid "%s case was found."
+msgid_plural "%s cases where found."
+msgstr[0] ""
+msgstr[1] ""
+
+#: mpulsweb/templates/casemanagement/overview.mako:25
+#, python-format
+msgid "Select the %s found case."
+msgid_plural "Select all %s found cases"
+msgstr[0] ""
+msgstr[1] ""
+
 #: mpulsweb/templates/casemanagement/search.mako:8
 msgid "Search"
 msgstr ""

Modified: wasko/branches/2.0/mpulsweb/templates/casemanagement/overview.mako
===================================================================
--- wasko/branches/2.0/mpulsweb/templates/casemanagement/overview.mako	2010-04-22 13:24:38 UTC (rev 2492)
+++ wasko/branches/2.0/mpulsweb/templates/casemanagement/overview.mako	2010-04-22 13:36:54 UTC (rev 2493)
@@ -15,13 +15,14 @@
  <!-- <p>${_('cm_overview_con_list_dossiers_cm')}</p>-->
 %endif
 <%include file="/casemanagement/search.mako" />
-Es wurden ${c.count_all} Fallakten gefunden
+${ungettext('%s case was found.', '%s cases where found.', c.count_all) % c.count_all}
 <div class="waska_form">
   <form action="/case_bundle/bundleAction" method="POST">
   <%include file="./caselist.mako" />
   % if g.mpuls_config.is_enabled('case-module', 'casebundle'):
   <div class="waska_form_element">
-    <input type="checkbox" name="all_cases" id="all_cases" value="1"><label for="all_cases">Alle angezeigten Fallakten (${c.count_all}) auswählen</label>
+    <input type="checkbox" name="all_cases" id="all_cases" value="1"><label for="all_cases">
+    ${ungettext('Select the %s found case.', 'Select all %s found cases', c.count_all) % c.count_all}</label>
   </div>
   <div class="waska_form_element w30">
     <select name="action">



More information about the Mpuls-commits mailing list