#2657,#1718 use ngettext
svn: r11773
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user