Final solution (I hope) for the % issue. Added generation to tool tip.

svn: r11890
This commit is contained in:
Peter Landgren
2009-02-07 08:56:33 +00:00
parent 28f4651f2b
commit 32ecf9b59a

View File

@@ -239,6 +239,7 @@ class PedigreeGramplet(Gramplet):
gens.sort() gens.sort()
self.append_text(_("\nBreakdown by generation:\n")) self.append_text(_("\nBreakdown by generation:\n"))
all = [active_person.handle] all = [active_person.handle]
percent_sign = _("percent sign or text string|%")
for g in gens: for g in gens:
count = len(self._generations[g]) count = len(self._generations[g])
handles = self._generations[g] handles = self._generations[g]
@@ -246,12 +247,15 @@ class PedigreeGramplet(Gramplet):
if g == 0: if g == 0:
self.link(_("Generation 1"), 'PersonList', handles, self.link(_("Generation 1"), 'PersonList', handles,
tooltip=_("Double-click to see people in generation")) tooltip=_("Double-click to see people in generation"))
self.append_text(_(" has 1 of 1 individual (100.00% complete)\n")) percent = '%.2f%s' % ( 100, percent_sign)
print percent_sign, percent
self.append_text(_(" has 1 of 1 individual (%(percent)s complete)\n") % {'percent': percent})
else: else:
all.extend(handles) all.extend(handles)
self.link(_("Generation %d") % g, 'PersonList', handles, self.link(_("Generation %d") % g, 'PersonList', handles,
tooltip=_("Double-click to see people in generation")) tooltip=_("Double-click to see people in generation %d") % g)
percent = '%.2f%%' % ( float(count)/2**(g-1) * 100) percent = '%.2f%s' % ( float(count)/2**(g-1) * 100, percent_sign)
print "plural", percent_sign, percent
self.append_text(ngettext( self.append_text(ngettext(
" has %(count_person)d of %(max_count_person)d individuals (%(percent)s complete)\n", " has %(count_person)d of %(max_count_person)d individuals (%(percent)s complete)\n",
" has %(count_person)d of %(max_count_person)d individuals (%(percent)s complete)\n", " has %(count_person)d of %(max_count_person)d individuals (%(percent)s complete)\n",