Use plural forms (ngettext) in plugins/tool/NotRelated (patch by VPeric)
svn: r13106
This commit is contained in:
parent
6d48930121
commit
d43de411bc
@ -29,6 +29,7 @@
|
|||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
import os
|
import os
|
||||||
|
from gettext import ngettext
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -231,7 +232,9 @@ class NotRelated(Tool.ActivePersonTool, ManagedWindow.ManagedWindow) :
|
|||||||
# if more than 1 person is selected, use a progress indicator
|
# if more than 1 person is selected, use a progress indicator
|
||||||
if rows > 1:
|
if rows > 1:
|
||||||
progress = Utils.ProgressMeter(self.title,_('Starting'))
|
progress = Utils.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
|
# start the db transaction
|
||||||
transaction = self.db.transaction_begin()
|
transaction = self.db.transaction_begin()
|
||||||
@ -263,7 +266,11 @@ class NotRelated(Tool.ActivePersonTool, ManagedWindow.ManagedWindow) :
|
|||||||
|
|
||||||
def findRelatedPeople(self) :
|
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
|
# as long as we have people we haven't processed yet, keep looping
|
||||||
while len(self.handlesOfPeopleToBeProcessed) > 0:
|
while len(self.handlesOfPeopleToBeProcessed) > 0:
|
||||||
@ -327,10 +334,10 @@ class NotRelated(Tool.ActivePersonTool, ManagedWindow.ManagedWindow) :
|
|||||||
if self.numberOfUnrelatedPeople > 0:
|
if self.numberOfUnrelatedPeople > 0:
|
||||||
# we have at least 1 "unrelated" person to find
|
# we have at least 1 "unrelated" person to find
|
||||||
|
|
||||||
if self.numberOfUnrelatedPeople == 1:
|
self.progress.set_pass( \
|
||||||
self.progress.set_pass(_('Looking for 1 person'), self.numberOfPeopleInDatabase)
|
ngettext("Looking for %d person", "Looking for %d people",\
|
||||||
else:
|
self.numberOfUnrelatedPeople) % self.numberOfUnrelatedPeople,\
|
||||||
self.progress.set_pass(_('Looking for %d people') % self.numberOfUnrelatedPeople, self.numberOfPeopleInDatabase)
|
self.numberOfPeopleInDatabase)
|
||||||
|
|
||||||
# loop through everyone in the database
|
# loop through everyone in the database
|
||||||
for handle in self.db.get_person_handles(False):
|
for handle in self.db.get_person_handles(False):
|
||||||
@ -352,10 +359,10 @@ class NotRelated(Tool.ActivePersonTool, ManagedWindow.ManagedWindow) :
|
|||||||
|
|
||||||
def populateModel(self) :
|
def populateModel(self) :
|
||||||
|
|
||||||
if self.numberOfUnrelatedPeople == 1:
|
self.progress.set_pass( \
|
||||||
self.progress.set_pass(_('Looking up the name for 1 person'), 1)
|
ngettext("Looking up the name of %d person", "Looking up the names of %d people", \
|
||||||
else:
|
self.numberOfUnrelatedPeople) % self.numberOfUnrelatedPeople,\
|
||||||
self.progress.set_pass(_('Looking up the names for %d people') % self.numberOfUnrelatedPeople, self.numberOfUnrelatedPeople)
|
self.numberOfUnrelatedPeople)
|
||||||
|
|
||||||
# loop through the entire list of unrelated people
|
# loop through the entire list of unrelated people
|
||||||
for handle in self.handlesOfPeopleNotRelated:
|
for handle in self.handlesOfPeopleNotRelated:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user