#2657,#1718 use ngettext

svn: r11773
This commit is contained in:
Jérôme Rapinat
2009-01-31 11:29:44 +00:00
parent 3d257ea84a
commit 1e6da8730c
8 changed files with 408 additions and 434 deletions

View File

@@ -28,6 +28,7 @@
#
#-------------------------------------------------------------------------
from TransUtils import sgettext as _
from gettext import ngettext
from cgi import escape
import math
@@ -1393,7 +1394,7 @@ class PedigreeView(PageView.PersonNavView):
size_menu.append(entry)
for n in range(2,6):
entry = gtk.ImageMenuItem(_("%d generations") % n)
entry = gtk.ImageMenuItem(ngettext("1 generation", "%d generations", n) %n)
if self.force_size == n:
entry.set_image(current_size_image)
entry.connect("activate", self.change_force_size_cb, n)

View File

@@ -29,6 +29,7 @@ Relationship View
#
#-------------------------------------------------------------------------
from TransUtils import sgettext as _
from gettext import ngettext
import cgi
#-------------------------------------------------------------------------
@@ -790,7 +791,7 @@ class RelationshipView(PageView.PersonNavView):
else:
count = 0
if count > 1 :
childmsg = _(" (%d siblings)") % count
childmsg = ngettext(" (1 sibling)", " (%d siblings)", count) % count
elif count == 1 :
gender = self.dbstate.db.get_person_from_handle(\
child_list[0]).gender
@@ -846,7 +847,7 @@ class RelationshipView(PageView.PersonNavView):
else:
count = 0
if count > 1 :
childmsg = _(" (%d siblings)") % count
childmsg = ngettext(" (1 sibling)"," (%d siblings)", count) % count
elif count == 1 :
gender = self.dbstate.db.get_person_from_handle(\
child_list[0]).gender
@@ -1265,10 +1266,8 @@ class RelationshipView(PageView.PersonNavView):
count = len(child_list)
else:
count = 0
if count > 1 :
childmsg = _(" (%d children)") % count
elif count == 1 :
childmsg = _(" (1 child)")
if count >= 1 :
childmsg = ngettext(" (1 child)"," (%d children)", count) % count
else :
childmsg = _(" (no children)")
box = self.get_people_box(handle, post_msg=childmsg)
@@ -1313,10 +1312,8 @@ class RelationshipView(PageView.PersonNavView):
count = len(child_list)
else:
count = 0
if count > 1 :
childmsg = _(" (%d children)") % count
elif count == 1 :
childmsg = _(" (1 child)")
if count >= 1 :
childmsg = ngettext(" (1 child)"," (%d children)", count) % count
else :
childmsg = _(" (no children)")
box = self.get_people_box(post_msg=childmsg)