From: gfawcett Date: Tue, 29 Mar 2011 01:53:37 +0000 (+0000) Subject: pluralize the message-texts for search-results screens. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=cd496385f62fba86494b35db3e4c12ac85564dcf;p=Syrup.git pluralize the message-texts for search-results screens. git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/branches/i18n@1292 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- diff --git a/conifer/locale/django.pot b/conifer/locale/django.pot index 9d13367..c9df9c3 100644 --- a/conifer/locale/django.pot +++ b/conifer/locale/django.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Syrup Reserves 0.1\n" "Report-Msgid-Bugs-To: Graham Fawcett \n" -"POT-Creation-Date: 2011-03-28 20:26-0400\n" +"POT-Creation-Date: 2011-03-28 21:49-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -632,8 +632,8 @@ msgstr "" msgid "Term" msgstr "" -#: templates/open_sites.xhtml:19 templates/search_results.xhtml:31 -#: templates/item/item_add_cat_search.xhtml:62 +#: templates/open_sites.xhtml:19 templates/search_results.xhtml:35 +#: templates/item/item_add_cat_search.xhtml:65 #: templates/item/item_delete_confirm.xhtml:28 #: templates/item/item_metadata.xhtml:46 msgid "Title" @@ -659,21 +659,28 @@ msgstr "" msgid "Search Results" msgstr "" -#: templates/search_results.xhtml:26 +#: templates/search_results.xhtml:27 #, python-format -msgid "You searched for: [1:%(query)s.] Found %(num)s matches." +msgid "You searched for: [1:%(query)s.]" msgstr "" -#: templates/search_results.xhtml:31 -#: templates/item/item_add_cat_search.xhtml:62 +#: templates/search_results.xhtml:28 +#, python-format +msgid "Found %(num)s match." +msgid_plural "Found %(num)s matches." +msgstr[0] "" +msgstr[1] "" + +#: templates/search_results.xhtml:35 +#: templates/item/item_add_cat_search.xhtml:65 msgid "Author" msgstr "" -#: templates/search_results.xhtml:31 +#: templates/search_results.xhtml:35 msgid "Site" msgstr "" -#: templates/search_results.xhtml:54 +#: templates/search_results.xhtml:58 msgid "Your searches may return more results if you [1:log in] before searching." msgstr "" @@ -1032,7 +1039,7 @@ msgid "Author #%(num)s" msgstr "" #: templates/item/common_metadata.xhtml:21 -#: templates/item/item_add_cat_search.xhtml:62 +#: templates/item/item_add_cat_search.xhtml:65 #: templates/item/item_metadata.xhtml:50 msgid "Publisher" msgstr "" @@ -1108,36 +1115,38 @@ msgstr "" #: templates/item/item_add_cat_search.xhtml:49 #, python-format -msgid "%(first)s–%(last)s of %(total)s results." -msgstr "" +msgid "%(first)s result." +msgid_plural "%(first)s–%(last)s of %(total)s results." +msgstr[0] "" +msgstr[1] "" -#: templates/item/item_add_cat_search.xhtml:51 +#: templates/item/item_add_cat_search.xhtml:54 #, python-format msgid "Previous %(count)s" msgstr "" -#: templates/item/item_add_cat_search.xhtml:55 +#: templates/item/item_add_cat_search.xhtml:58 #, python-format msgid "Next %(count)s" msgstr "" -#: templates/item/item_add_cat_search.xhtml:62 +#: templates/item/item_add_cat_search.xhtml:65 msgid "PubDate" msgstr "" -#: templates/item/item_add_cat_search.xhtml:70 +#: templates/item/item_add_cat_search.xhtml:73 msgid "details" msgstr "" -#: templates/item/item_add_cat_search.xhtml:71 +#: templates/item/item_add_cat_search.xhtml:74 msgid "Electronic resource." msgstr "" -#: templates/item/item_add_cat_search.xhtml:72 +#: templates/item/item_add_cat_search.xhtml:75 msgid "view" msgstr "" -#: templates/item/item_add_cat_search.xhtml:82 +#: templates/item/item_add_cat_search.xhtml:85 msgid "Pick this item" msgstr "" @@ -1330,6 +1339,7 @@ msgstr "" msgid "Click here to download the document." msgstr "" +#. Bytes will always be plural! #: templates/item/item_metadata.xhtml:113 #, python-format msgid "Document type: %(type)s. Size: %(bytes)s bytes." diff --git a/conifer/locale/en_CA/LC_MESSAGES/django.po b/conifer/locale/en_CA/LC_MESSAGES/django.po index bdcd961..3cb8668 100644 --- a/conifer/locale/en_CA/LC_MESSAGES/django.po +++ b/conifer/locale/en_CA/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Syrup Reserves 0.1\n" "Report-Msgid-Bugs-To: Graham Fawcett \n" "POT-Creation-Date: 2011-03-28 20:22+0400\n" -"PO-Revision-Date: 2011-03-28 20:26-0400\n" +"PO-Revision-Date: 2011-03-28 21:49-0400\n" "Last-Translator: FULL NAME \n" "Language-Team: en_CA \n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" @@ -634,8 +634,8 @@ msgstr "" msgid "Term" msgstr "" -#: templates/open_sites.xhtml:19 templates/search_results.xhtml:31 -#: templates/item/item_add_cat_search.xhtml:62 +#: templates/open_sites.xhtml:19 templates/search_results.xhtml:35 +#: templates/item/item_add_cat_search.xhtml:65 #: templates/item/item_delete_confirm.xhtml:28 #: templates/item/item_metadata.xhtml:46 msgid "Title" @@ -661,21 +661,28 @@ msgstr "" msgid "Search Results" msgstr "" -#: templates/search_results.xhtml:26 +#: templates/search_results.xhtml:27 #, python-format -msgid "You searched for: [1:%(query)s.] Found %(num)s matches." +msgid "You searched for: [1:%(query)s.]" msgstr "" -#: templates/search_results.xhtml:31 -#: templates/item/item_add_cat_search.xhtml:62 +#: templates/search_results.xhtml:28 +#, fuzzy, python-format +msgid "Found %(num)s match." +msgid_plural "Found %(num)s matches." +msgstr[0] "" +msgstr[1] "" + +#: templates/search_results.xhtml:35 +#: templates/item/item_add_cat_search.xhtml:65 msgid "Author" msgstr "" -#: templates/search_results.xhtml:31 +#: templates/search_results.xhtml:35 msgid "Site" msgstr "" -#: templates/search_results.xhtml:54 +#: templates/search_results.xhtml:58 msgid "Your searches may return more results if you [1:log in] before searching." msgstr "" @@ -1034,7 +1041,7 @@ msgid "Author #%(num)s" msgstr "" #: templates/item/common_metadata.xhtml:21 -#: templates/item/item_add_cat_search.xhtml:62 +#: templates/item/item_add_cat_search.xhtml:65 #: templates/item/item_metadata.xhtml:50 msgid "Publisher" msgstr "" @@ -1109,37 +1116,39 @@ msgid "Search" msgstr "" #: templates/item/item_add_cat_search.xhtml:49 -#, python-format -msgid "%(first)s–%(last)s of %(total)s results." -msgstr "" +#, fuzzy, python-format +msgid "%(first)s result." +msgid_plural "%(first)s–%(last)s of %(total)s results." +msgstr[0] "" +msgstr[1] "" -#: templates/item/item_add_cat_search.xhtml:51 +#: templates/item/item_add_cat_search.xhtml:54 #, python-format msgid "Previous %(count)s" msgstr "" -#: templates/item/item_add_cat_search.xhtml:55 +#: templates/item/item_add_cat_search.xhtml:58 #, python-format msgid "Next %(count)s" msgstr "" -#: templates/item/item_add_cat_search.xhtml:62 +#: templates/item/item_add_cat_search.xhtml:65 msgid "PubDate" msgstr "" -#: templates/item/item_add_cat_search.xhtml:70 +#: templates/item/item_add_cat_search.xhtml:73 msgid "details" msgstr "" -#: templates/item/item_add_cat_search.xhtml:71 +#: templates/item/item_add_cat_search.xhtml:74 msgid "Electronic resource." msgstr "" -#: templates/item/item_add_cat_search.xhtml:72 +#: templates/item/item_add_cat_search.xhtml:75 msgid "view" msgstr "" -#: templates/item/item_add_cat_search.xhtml:82 +#: templates/item/item_add_cat_search.xhtml:85 msgid "Pick this item" msgstr "" @@ -1332,6 +1341,7 @@ msgstr "" msgid "Click here to download the document." msgstr "" +#. Bytes will always be plural! #: templates/item/item_metadata.xhtml:113 #, python-format msgid "Document type: %(type)s. Size: %(bytes)s bytes." diff --git a/conifer/locale/eo/LC_MESSAGES/django.po b/conifer/locale/eo/LC_MESSAGES/django.po index e95db39..214df61 100644 --- a/conifer/locale/eo/LC_MESSAGES/django.po +++ b/conifer/locale/eo/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Syrup Reserves 0.1\n" "Report-Msgid-Bugs-To: Graham Fawcett \n" "POT-Creation-Date: 2011-03-28 20:22+0400\n" -"PO-Revision-Date: 2011-03-28 20:26-0400\n" +"PO-Revision-Date: 2011-03-28 21:49-0400\n" "Last-Translator: FULL NAME \n" "Language-Team: eo \n" "MIME-Version: 1.0\n" @@ -648,8 +648,8 @@ msgstr "opEn SItEs" msgid "Term" msgstr "TErm" -#: templates/open_sites.xhtml:19 templates/search_results.xhtml:31 -#: templates/item/item_add_cat_search.xhtml:62 +#: templates/open_sites.xhtml:19 templates/search_results.xhtml:35 +#: templates/item/item_add_cat_search.xhtml:65 #: templates/item/item_delete_confirm.xhtml:28 #: templates/item/item_metadata.xhtml:46 msgid "Title" @@ -675,21 +675,28 @@ msgstr "ChAngE" msgid "Search Results" msgstr "SEArch REsUlts" -#: templates/search_results.xhtml:26 +#: templates/search_results.xhtml:27 #, python-format -msgid "You searched for: [1:%(query)s.] Found %(num)s matches." -msgstr "YOU sEArchEd fOr: [1:%(query)s.] FOUnd %(num)s mAtchEs." +msgid "You searched for: [1:%(query)s.]" +msgstr "YOU sEArchEd fOr: [1:%(query)s.]" -#: templates/search_results.xhtml:31 -#: templates/item/item_add_cat_search.xhtml:62 +#: templates/search_results.xhtml:28 +#, python-format +msgid "Found %(num)s match." +msgid_plural "Found %(num)s matches." +msgstr[0] "FOUnd %(num)s mAtch." +msgstr[1] "FOUnd %(num)s mAtchEs." + +#: templates/search_results.xhtml:35 +#: templates/item/item_add_cat_search.xhtml:65 msgid "Author" msgstr "aUthOr" -#: templates/search_results.xhtml:31 +#: templates/search_results.xhtml:35 msgid "Site" msgstr "SItE" -#: templates/search_results.xhtml:54 +#: templates/search_results.xhtml:58 msgid "" "Your searches may return more results if you [1:log in] before searching." msgstr "" @@ -1056,7 +1063,7 @@ msgid "Author #%(num)s" msgstr "aUthOr #%(num)s" #: templates/item/common_metadata.xhtml:21 -#: templates/item/item_add_cat_search.xhtml:62 +#: templates/item/item_add_cat_search.xhtml:65 #: templates/item/item_metadata.xhtml:50 msgid "Publisher" msgstr "PUblIshEr" @@ -1132,36 +1139,38 @@ msgstr "SEArch" #: templates/item/item_add_cat_search.xhtml:49 #, python-format -msgid "%(first)s–%(last)s of %(total)s results." -msgstr "%(first)s–%(last)s Of %(total)s rEsUlts." +msgid "%(first)s result." +msgid_plural "%(first)s–%(last)s of %(total)s results." +msgstr[0] "%(first)s rEsUlt." +msgstr[1] "%(first)s–%(last)s Of %(total)s rEsUlts." -#: templates/item/item_add_cat_search.xhtml:51 +#: templates/item/item_add_cat_search.xhtml:54 #, python-format msgid "Previous %(count)s" msgstr "PrEvIOUs %(count)s" -#: templates/item/item_add_cat_search.xhtml:55 +#: templates/item/item_add_cat_search.xhtml:58 #, python-format msgid "Next %(count)s" msgstr "NExt %(count)s" -#: templates/item/item_add_cat_search.xhtml:62 +#: templates/item/item_add_cat_search.xhtml:65 msgid "PubDate" msgstr "PUbDAtE" -#: templates/item/item_add_cat_search.xhtml:70 +#: templates/item/item_add_cat_search.xhtml:73 msgid "details" msgstr "dEtAIls" -#: templates/item/item_add_cat_search.xhtml:71 +#: templates/item/item_add_cat_search.xhtml:74 msgid "Electronic resource." msgstr "elEctrOnIc rEsOUrcE." -#: templates/item/item_add_cat_search.xhtml:72 +#: templates/item/item_add_cat_search.xhtml:75 msgid "view" msgstr "vIEw" -#: templates/item/item_add_cat_search.xhtml:82 +#: templates/item/item_add_cat_search.xhtml:85 msgid "Pick this item" msgstr "PIck thIs ItEm" @@ -1363,6 +1372,7 @@ msgstr "REqUEst tO dOwnlOAd thIs dOcUmEnt" msgid "Click here to download the document." msgstr "ClIck hErE tO dOwnlOAd thE dOcUmEnt." +#. Bytes will always be plural! #: templates/item/item_metadata.xhtml:113 #, python-format msgid "Document type: %(type)s. Size: %(bytes)s bytes." diff --git a/conifer/locale/fr_CA/LC_MESSAGES/django.po b/conifer/locale/fr_CA/LC_MESSAGES/django.po index 7f31b41..68e4347 100644 --- a/conifer/locale/fr_CA/LC_MESSAGES/django.po +++ b/conifer/locale/fr_CA/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Syrup Reserves 0.1\n" "Report-Msgid-Bugs-To: Graham Fawcett \n" "POT-Creation-Date: 2011-03-28 20:22+0400\n" -"PO-Revision-Date: 2011-03-28 20:26-0400\n" +"PO-Revision-Date: 2011-03-28 21:49-0400\n" "Last-Translator: FULL NAME \n" "Language-Team: fr_CA \n" "Plural-Forms: nplurals=2; plural=(n > 1)\n" @@ -634,8 +634,8 @@ msgstr "" msgid "Term" msgstr "" -#: templates/open_sites.xhtml:19 templates/search_results.xhtml:31 -#: templates/item/item_add_cat_search.xhtml:62 +#: templates/open_sites.xhtml:19 templates/search_results.xhtml:35 +#: templates/item/item_add_cat_search.xhtml:65 #: templates/item/item_delete_confirm.xhtml:28 #: templates/item/item_metadata.xhtml:46 msgid "Title" @@ -661,21 +661,28 @@ msgstr "" msgid "Search Results" msgstr "" -#: templates/search_results.xhtml:26 +#: templates/search_results.xhtml:27 #, python-format -msgid "You searched for: [1:%(query)s.] Found %(num)s matches." +msgid "You searched for: [1:%(query)s.]" msgstr "" -#: templates/search_results.xhtml:31 -#: templates/item/item_add_cat_search.xhtml:62 +#: templates/search_results.xhtml:28 +#, fuzzy, python-format +msgid "Found %(num)s match." +msgid_plural "Found %(num)s matches." +msgstr[0] "" +msgstr[1] "" + +#: templates/search_results.xhtml:35 +#: templates/item/item_add_cat_search.xhtml:65 msgid "Author" msgstr "" -#: templates/search_results.xhtml:31 +#: templates/search_results.xhtml:35 msgid "Site" msgstr "" -#: templates/search_results.xhtml:54 +#: templates/search_results.xhtml:58 msgid "Your searches may return more results if you [1:log in] before searching." msgstr "" @@ -1034,7 +1041,7 @@ msgid "Author #%(num)s" msgstr "" #: templates/item/common_metadata.xhtml:21 -#: templates/item/item_add_cat_search.xhtml:62 +#: templates/item/item_add_cat_search.xhtml:65 #: templates/item/item_metadata.xhtml:50 msgid "Publisher" msgstr "" @@ -1109,37 +1116,39 @@ msgid "Search" msgstr "" #: templates/item/item_add_cat_search.xhtml:49 -#, python-format -msgid "%(first)s–%(last)s of %(total)s results." -msgstr "" +#, fuzzy, python-format +msgid "%(first)s result." +msgid_plural "%(first)s–%(last)s of %(total)s results." +msgstr[0] "" +msgstr[1] "" -#: templates/item/item_add_cat_search.xhtml:51 +#: templates/item/item_add_cat_search.xhtml:54 #, python-format msgid "Previous %(count)s" msgstr "" -#: templates/item/item_add_cat_search.xhtml:55 +#: templates/item/item_add_cat_search.xhtml:58 #, python-format msgid "Next %(count)s" msgstr "" -#: templates/item/item_add_cat_search.xhtml:62 +#: templates/item/item_add_cat_search.xhtml:65 msgid "PubDate" msgstr "" -#: templates/item/item_add_cat_search.xhtml:70 +#: templates/item/item_add_cat_search.xhtml:73 msgid "details" msgstr "" -#: templates/item/item_add_cat_search.xhtml:71 +#: templates/item/item_add_cat_search.xhtml:74 msgid "Electronic resource." msgstr "" -#: templates/item/item_add_cat_search.xhtml:72 +#: templates/item/item_add_cat_search.xhtml:75 msgid "view" msgstr "" -#: templates/item/item_add_cat_search.xhtml:82 +#: templates/item/item_add_cat_search.xhtml:85 msgid "Pick this item" msgstr "" @@ -1332,6 +1341,7 @@ msgstr "" msgid "Click here to download the document." msgstr "" +#. Bytes will always be plural! #: templates/item/item_metadata.xhtml:113 #, python-format msgid "Document type: %(type)s. Size: %(bytes)s bytes." diff --git a/conifer/plumbing/genshi_support.py b/conifer/plumbing/genshi_support.py index 0b4ea55..455dbed 100644 --- a/conifer/plumbing/genshi_support.py +++ b/conifer/plumbing/genshi_support.py @@ -7,7 +7,7 @@ from genshi.builder import tag import genshi.output from django.conf import settings from warnings import warn -from django.utils.translation import ugettext +import django.utils.translation try: from threading import local @@ -31,7 +31,7 @@ def get_request(): #--------------------------------------------------------------------------- # Templating support -translator = Translator(ugettext) +translator = Translator(django.utils.translation) class TemplateSet(object): diff --git a/conifer/syrup/views/genshi_namespace.py b/conifer/syrup/views/genshi_namespace.py index 431202c..aaa63dc 100644 --- a/conifer/syrup/views/genshi_namespace.py +++ b/conifer/syrup/views/genshi_namespace.py @@ -15,3 +15,4 @@ from conifer.plumbing.hooksystem import gethook, callhook from conifer.syrup import models from django.conf import settings from django.utils.translation import ugettext as _ +from django.utils.translation import ngettext diff --git a/conifer/templates/item/item_add_cat_search.xhtml b/conifer/templates/item/item_add_cat_search.xhtml index e725c7e..faa3124 100644 --- a/conifer/templates/item/item_add_cat_search.xhtml +++ b/conifer/templates/item/item_add_cat_search.xhtml @@ -46,12 +46,16 @@ dc_keys = ['dc:title', 'dc:creator', 'dc:publisher', 'dc:date']

- ${start}–${min(numhits, start+limit-1)} of ${numhits} results. + + ${numhits} result. + ${start}–${min(numhits, start+limit-1)} of ${numhits} results. + - Previous ${limit} • + Previous ${limit} + • Next ${limit}

diff --git a/conifer/templates/item/item_metadata.xhtml b/conifer/templates/item/item_metadata.xhtml index ee444d8..1440d29 100644 --- a/conifer/templates/item/item_metadata.xhtml +++ b/conifer/templates/item/item_metadata.xhtml @@ -110,7 +110,7 @@ callnum = item.call_number()

-

Document type: ${item.fileobj_mimetype}. Size: ${item.fileobj.size} bytes.

+

Document type: ${item.fileobj_mimetype}. Size: ${item.fileobj.size} bytes.

diff --git a/conifer/templates/search_results.xhtml b/conifer/templates/search_results.xhtml index 6a54e84..ec696ea 100644 --- a/conifer/templates/search_results.xhtml +++ b/conifer/templates/search_results.xhtml @@ -23,8 +23,12 @@ title = _('Search Results') alt="lock" title="This resource is access-controlled."/> -

- You searched for: ${query_string}. Found ${len(results)} matches. +

+ You searched for: ${query_string}. + + Found ${len(results)} match. + Found ${len(results)} matches. +