#2657,#1718 use ngettext

svn: r11800
This commit is contained in:
Jérôme Rapinat
2009-02-02 17:13:02 +00:00
parent 1ecbaae622
commit e4f5ad0142
7 changed files with 1386 additions and 1328 deletions

View File

@@ -32,6 +32,7 @@ import DateHandler
import posixpath
from gettext import gettext as _
from gettext import ngettext
# force translation
[_('all people'), _('males'), _('females'), _('people with unknown gender'),
@@ -216,7 +217,9 @@ def run(database, document, filter_name, *args, **kwargs):
matches += 1
else:
raise AttributeError, ("invalid filter name: '%s'" % filter_name)
sdoc.paragraph(_("Filter matched %d records.") % matches)
sdoc.paragraph(ngettext("Filter matched %d record."
,
"Filter matched %d records.", matches) % matches)
sdoc.paragraph("")
if matches > 0:
stab.write(sdoc)

View File

@@ -26,6 +26,7 @@ Display a people who have a person's same surname or given name
from Simple import SimpleAccess, SimpleDoc, SimpleTable
from gettext import gettext as _
from gettext import ngettext
from gen.plug import PluginManager
import gen.lib
from ReportBase import CATEGORY_QR_PERSON, CATEGORY_QR_MISC
@@ -118,7 +119,10 @@ def run(database, document, person):
stab.row(person, sdb.birth_date_obj(person),
str(person.get_primary_name().get_type()))
matches += 1
sdoc.paragraph(_("There are %d people with a matching name, or alternate name.\n") % matches)
sdoc.paragraph(ngettext("There is %d person with a matching name, or alternate name.\n"
,
"There are %d people with a matching name, or alternate name.\n"
, matches) % matches)
stab.write(sdoc)
def run_given(database, document, person):
@@ -154,7 +158,10 @@ def run_given(database, document, person):
stab.row(person, sdb.birth_date_obj(person),
str(person.get_primary_name().get_type()))
matches += 1
sdoc.paragraph(_("There are %d people with a matching name, or alternate name.\n") % matches)
sdoc.paragraph(ngettext("There is %d person with a matching name, or alternate name.\n"
,
"There are %d people with a matching name, or alternate name.\n"
, matches) % matches)
stab.write(sdoc)
#------------------------------------------------------------------------