Use plural forms (ngettext) in plugins/tool/NotRelated (patch by VPeric)

svn: r13107
This commit is contained in:
Jérôme Rapinat 2009-08-23 07:39:29 +00:00
parent d0ca4b6116
commit 21779f0cb3

View File

@ -37,6 +37,7 @@ import gobject
#
#------------------------------------------------------------------------
import const
from gettext import ngettext
from PluginUtils import Tool
from gen.plug import PluginManager
from ReportBase import ReportUtils
@ -227,7 +228,9 @@ class NotRelated(Tool.ActivePersonTool, ManagedWindow.ManagedWindow) :
# if more than 1 person is selected, use a progress indicator
if rows > 1:
progress = ProgressMeter(self.title,_('Starting'))
progress.set_pass(_('Setting marker for %d people') % rows, rows)
#TRANS: no singular form needed, as rows is always > 1
progress.set_pass(ngettext("", 'Setting marker for %d people', \
rows) % rows, rows)
# start the db transaction
transaction = self.db.transaction_begin()
@ -259,8 +262,11 @@ class NotRelated(Tool.ActivePersonTool, ManagedWindow.ManagedWindow) :
def findRelatedPeople(self) :
self.progress.set_pass(_('Finding relationships between %d people') %
self.numberOfPeopleInDatabase, self.numberOfPeopleInDatabase)
#TRANS: No singular form is needed.
self.progress.set_pass(ngettext("", "Finding relationships between %d people",\
self.numberOfPeopleInDatabase) \
% self.numberOfPeopleInDatabase, \
self.numberOfPeopleInDatabase)
# as long as we have people we haven't processed yet, keep looping
while len(self.handlesOfPeopleToBeProcessed) > 0:
@ -325,12 +331,10 @@ class NotRelated(Tool.ActivePersonTool, ManagedWindow.ManagedWindow) :
if self.numberOfUnrelatedPeople > 0:
# we have at least 1 "unrelated" person to find
if self.numberOfUnrelatedPeople == 1:
self.progress.set_pass(_('Looking for 1 person'),
self.progress.set_pass( \
ngettext("Looking for %d person", "Looking for %d people",\
self.numberOfUnrelatedPeople) % self.numberOfUnrelatedPeople,\
self.numberOfPeopleInDatabase)
else:
self.progress.set_pass(_('Looking for %d people') %
self.numberOfUnrelatedPeople, self.numberOfPeopleInDatabase)
# loop through everyone in the database
for handle in self.db.iter_person_handles():
@ -352,11 +356,10 @@ class NotRelated(Tool.ActivePersonTool, ManagedWindow.ManagedWindow) :
def populateModel(self) :
if self.numberOfUnrelatedPeople == 1:
self.progress.set_pass(_('Looking up the name for 1 person'), 1)
else:
self.progress.set_pass(_('Looking up the names for %d people') %
self.numberOfUnrelatedPeople, self.numberOfUnrelatedPeople)
self.progress.set_pass( \
ngettext("Looking up the name of %d person", "Looking up the names of %d people", \
self.numberOfUnrelatedPeople) % self.numberOfUnrelatedPeople,\
self.numberOfUnrelatedPeople)
# loop through the entire list of unrelated people
for handle in self.handlesOfPeopleNotRelated: