#2657,#1718 use ngettext
svn: r11848
This commit is contained in:
parent
1e8ec7eb2d
commit
d587ffe618
@ -23,6 +23,7 @@
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from gettext import gettext as _
|
||||
from gettext import ngettext
|
||||
import datetime
|
||||
import time
|
||||
|
||||
@ -290,10 +291,11 @@ class Calendar(Report):
|
||||
'person' : short_name,
|
||||
'relation' : ""}
|
||||
else:
|
||||
text = _('%(person)s, %(age)d%(relation)s') % {
|
||||
'person' : short_name,
|
||||
'age' : nyears,
|
||||
'relation' : ""}
|
||||
text = ngettext('%(person)s, %(age)d%(relation)s',
|
||||
'%(person)s, %(age)d%(relation)s', nyears)
|
||||
% {'person' : short_name,
|
||||
'age' : nyears,
|
||||
'relation' : ""}
|
||||
self.add_day_item(text, month, day)
|
||||
if self.anniversaries:
|
||||
family_list = person.get_family_handle_list()
|
||||
@ -340,10 +342,11 @@ class Calendar(Report):
|
||||
'person' : short_name,
|
||||
}
|
||||
else:
|
||||
text = _("%(spouse)s and\n %(person)s, %(nyears)d") % {
|
||||
'spouse' : spouse_name,
|
||||
'person' : short_name,
|
||||
'nyears' : nyears}
|
||||
text = ngettext("%(spouse)s and\n %(person)s, %(nyears)d",
|
||||
"%(spouse)s and\n %(person)s, %(nyears)d", nyears)
|
||||
% {'spouse' : spouse_name,
|
||||
'person' : short_name,
|
||||
'nyears' : nyears}
|
||||
|
||||
alive1 = probably_alive(person, self.database, \
|
||||
prob_alive_date)
|
||||
|
@ -23,6 +23,7 @@
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from gettext import gettext as _
|
||||
from gettext import ngettext
|
||||
import datetime
|
||||
import time
|
||||
|
||||
@ -246,10 +247,11 @@ class CalendarReport(Report):
|
||||
'person' : short_name,
|
||||
'relation' : comment}
|
||||
else:
|
||||
text = _('%(person)s, %(age)d%(relation)s') % {
|
||||
'person' : short_name,
|
||||
'age' : nyears,
|
||||
'relation' : comment}
|
||||
text = ngettext('%(person)s, %(age)d%(relation)s',
|
||||
'%(person)s, %(age)d%(relation)s', nyears)
|
||||
% {'person' : short_name,
|
||||
'age' : nyears,
|
||||
'relation' : comment}
|
||||
|
||||
self.add_day_item(text, month, day)
|
||||
if self.anniversaries:
|
||||
@ -293,10 +295,11 @@ class CalendarReport(Report):
|
||||
'spouse' : spouse_name,
|
||||
'person' : short_name}
|
||||
else:
|
||||
text = _("%(spouse)s and\n %(person)s, %(nyears)d") % {
|
||||
'spouse' : spouse_name,
|
||||
'person' : short_name,
|
||||
'nyears' : nyears}
|
||||
text = ngettext("%(spouse)s and\n %(person)s, %(nyears)d",
|
||||
"%(spouse)s and\n %(person)s, %(nyears)d", nyears)
|
||||
% {'spouse' : spouse_name,
|
||||
'person' : short_name,
|
||||
'nyears' : nyears}
|
||||
|
||||
prob_alive_date = gen.lib.Date(self.year, month, day)
|
||||
alive1 = probably_alive(person, self.database, \
|
||||
|
@ -48,6 +48,7 @@ import calendar
|
||||
import codecs
|
||||
import shutil
|
||||
from gettext import gettext as _
|
||||
from gettext import ngettext
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
@ -1527,9 +1528,9 @@ def get_day_list(event_date, holiday_list, bday_anniv_list):
|
||||
txt_str = _('%(person)s, <em>birth</em>') % {
|
||||
'person' : text}
|
||||
else:
|
||||
txt_str = _('%(person)s, <em>%(age)s</em> old') % {
|
||||
'person' : text,
|
||||
'age' : age_str}
|
||||
txt_str = ngettext('%(person)s, <em>%(age)s</em> old',
|
||||
'%(person)s, <em>%(age)s</em> old', age_str)
|
||||
% {'person' : text, 'age' : age_str}
|
||||
|
||||
# an anniversary
|
||||
elif event == 'Anniversary':
|
||||
@ -1538,9 +1539,9 @@ def get_day_list(event_date, holiday_list, bday_anniv_list):
|
||||
txt_str = _('%(couple)s, <em>wedding</em>') % {
|
||||
'couple' : text}
|
||||
else:
|
||||
txt_str = _('%(couple)s, <em>%(years)d</em> year anniversary') % {
|
||||
'couple' : text,
|
||||
'years' : nyears}
|
||||
txt_str = ngettext('%(couple)s, <em>%(years)d</em> year anniversary'
|
||||
'%(couple)s, <em>%(years)d</em> year anniversary', nyears)
|
||||
% {'couple' : text, 'years' : nyears}
|
||||
txt_str = '<span class="yearsmarried">%s</span>' % txt_str
|
||||
|
||||
if txt_str is not None:
|
||||
|
Loading…
Reference in New Issue
Block a user