From 21779f0cb323552495642c220d2d5702cefdb41e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Rapinat?= Date: Sun, 23 Aug 2009 07:39:29 +0000 Subject: [PATCH] Use plural forms (ngettext) in plugins/tool/NotRelated (patch by VPeric) svn: r13107 --- src/plugins/tool/NotRelated.py | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/plugins/tool/NotRelated.py b/src/plugins/tool/NotRelated.py index 7a390cdc7..33231012f 100644 --- a/src/plugins/tool/NotRelated.py +++ b/src/plugins/tool/NotRelated.py @@ -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.numberOfPeopleInDatabase) - else: - self.progress.set_pass(_('Looking for %d people') % - self.numberOfUnrelatedPeople, self.numberOfPeopleInDatabase) + self.progress.set_pass( \ + ngettext("Looking for %d person", "Looking for %d people",\ + self.numberOfUnrelatedPeople) % 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: