Restored 0 years, but with word 'birth' or 'wedding'; removed extra words as they are too long for calendar

svn: r11741
This commit is contained in:
Doug Blank 2009-01-27 02:28:47 +00:00
parent b2b0573d36
commit 470ad5d62e

View File

@ -309,8 +309,6 @@ class Calendar(Report):
""" """
This method runs through the data, and collects the relevant dates This method runs through the data, and collects the relevant dates
and text. and text.
age and years must be greater than zero, else why do it???
""" """
people = self.database.get_person_handles(sort_handles=False) people = self.database.get_person_handles(sort_handles=False)
self.progress.set_pass(_('Applying Filter...'), len(people)) self.progress.set_pass(_('Applying Filter...'), len(people))
@ -351,7 +349,7 @@ class Calendar(Report):
if father is not None: if father is not None:
father_lastname = father.get_primary_name().get_surname() father_lastname = father.get_primary_name().get_surname()
short_name = self.get_name(person, father_lastname) short_name = self.get_name(person, father_lastname)
if age > 0: if age >= 0:
alive = probably_alive(person, self.database, make_date(self.year, month, day)) alive = probably_alive(person, self.database, make_date(self.year, month, day))
if ((self.alive and alive) or not self.alive): if ((self.alive and alive) or not self.alive):
comment = "" comment = ""
@ -362,7 +360,10 @@ class Calendar(Report):
person) person)
if relation: if relation:
comment = " --- %s" % relation comment = " --- %s" % relation
self.add_day_item("%s, %d%s" % (short_name, age, comment), self.year, month, day) if age == 0:
self.add_day_item("%s, birth%s" % (short_name, comment), self.year, month, day)
else:
self.add_day_item("%s, %d%s" % (short_name, age, comment), self.year, month, day)
if self.anniversaries: if self.anniversaries:
family_list = person.get_family_handle_list() family_list = person.get_family_handle_list()
for fhandle in family_list: for fhandle in family_list:
@ -399,12 +400,18 @@ class Calendar(Report):
month = event_obj.get_month() month = event_obj.get_month()
day = event_obj.get_day() day = event_obj.get_day()
years = self.year - year years = self.year - year
if years > 0: if years >= 0:
text = _("%(spouse)s and\n %(person)s, %(nyears)d year anniversary") % { if years == 0:
'spouse' : spouse_name, text = _("%(spouse)s and\n %(person)s, wedding") % {
'person' : short_name, 'spouse' : spouse_name,
'nyears' : years, 'person' : short_name,
} }
else:
text = _("%(spouse)s and\n %(person)s, %(nyears)d") % {
'spouse' : spouse_name,
'person' : short_name,
'nyears' : years,
}
alive1 = probably_alive(person, self.database, make_date(self.year, month, day)) alive1 = probably_alive(person, self.database, make_date(self.year, month, day))
alive2 = probably_alive(spouse, self.database, make_date(self.year, month, day)) alive2 = probably_alive(spouse, self.database, make_date(self.year, month, day))
if ((self.alive and alive1 and alive2) or not self.alive): if ((self.alive and alive1 and alive2) or not self.alive):