tweak "living people" option (change option report output)

This commit is contained in:
Paul Franklin 2016-04-28 09:22:08 -07:00
parent 94030eab5f
commit af995ad48b
6 changed files with 22 additions and 15 deletions

View File

@ -69,7 +69,7 @@ class Report(object):
if language == GrampsLocale.DEFAULT_TRANSLATION_STR:
language = None
locale = GrampsLocale(lang=language)
self._ = locale.translation.gettext
self._ = locale.translation.sgettext
self._get_date = locale.get_date
self._get_type = locale.get_type
self._ldd = locale.date_displayer

View File

@ -751,7 +751,7 @@ class StatisticsChart(Report):
filter_opt = get_option_by_name('filter')
self.filter = filter_opt.get_filter()
self.fil_name = self.filter.get_name(rlocale)
self.fil_name = "(%s)" % self.filter.get_name(rlocale)
self.bar_items = get_value('bar_items')
year_from = get_value('year_from')
@ -761,8 +761,10 @@ class StatisticsChart(Report):
living_value = get_value('living_people')
for (value, description) in living_opt.get_items(xml_items=True):
if value == living_value:
self.living_desc = '(%s)' % self._(description)
living_desc = self._(description)
break
self.living_desc = self._("(Living people: %(option_name)s)"
% {'option_name': living_desc})
# title needs both data extraction method name + gender name
if gender == Person.MALE:

View File

@ -103,19 +103,20 @@ class TimeLine(Report):
lang = options.menu.get_option_by_name('trans').get_value()
rlocale = self.set_locale(lang)
self._ = rlocale.translation.sgettext
stdoptions.run_private_data_option(self, menu)
living_opt = stdoptions.run_living_people_option(self, menu, rlocale)
self.filter = menu.get_option_by_name('filter').get_filter()
self.fil_name = self.filter.get_name(rlocale)
self.fil_name = "(%s)" % self.filter.get_name(rlocale)
living_value = menu.get_option_by_name('living_people').get_value()
for (value, description) in living_opt.get_items(xml_items=True):
if value == living_value:
self.living_desc = self._(description)
living_desc = self._(description)
break
self.living_desc = self._("(Living people: %(option_name)s)"
% {'option_name': living_desc})
stdoptions.run_name_format_option(self, menu)
@ -261,11 +262,11 @@ class TimeLine(Report):
Draws the title for the page.
"""
width = self.doc.get_usable_width()
title = self._("Timeline Chart")
title3 = "%(str1)s -- %(str2)s" % {
'str1' : self.living_desc,
title = "%(str1)s -- %(str2)s" % {
'str1' : self._("Timeline Chart"),
# feature request 2356: avoid genitive form
'str2' : self._("Sorted by %s") % self.sort_name }
title3 = self.living_desc
mark = None
if toc:
mark = IndexMark(title, INDEX_TYPE_TOC, 1)

View File

@ -84,7 +84,6 @@ class PlaceReport(Report):
lang = menu.get_option_by_name('trans').get_value()
rlocale = self.set_locale(lang)
self._ = rlocale.translation.sgettext
stdoptions.run_private_data_option(self, menu)
living_opt = stdoptions.run_living_people_option(self, menu, rlocale)
@ -92,8 +91,10 @@ class PlaceReport(Report):
self._lv = menu.get_option_by_name('living_people').get_value()
for (value, description) in living_opt.get_items(xml_items=True):
if value == self._lv:
self.living_desc = '(%s)' % self._(description)
living_desc = self._(description)
break
self.living_desc = self._("(Living people: %(option_name)s)"
% {'option_name': living_desc})
places = menu.get_option_by_name('places').get_value()
self.center = menu.get_option_by_name('center').get_value()

View File

@ -81,8 +81,10 @@ class RecordsReport(Report):
self._lv = menu.get_option_by_name('living_people').get_value()
for (value, description) in living_opt.get_items(xml_items=True):
if value == self._lv:
self.living_desc = self._(description)
living_desc = self._(description)
break
self.living_desc = self._("(Living people: %(option_name)s)"
% {'option_name': living_desc})
filter_option = menu.get_option_by_name('filter')
self.filter = filter_option.get_filter()
@ -119,8 +121,7 @@ class RecordsReport(Report):
self.doc.end_paragraph()
if self._lv != LivingProxyDb.MODE_INCLUDE_ALL:
self.doc.start_paragraph('REC-Subtitle')
self.doc.write_text(self._("(Living people: %(option_name)s)"
% {'option_name': self.living_desc}))
self.doc.write_text(self.living_desc)
self.doc.end_paragraph()
for (text, varname, top) in records:

View File

@ -92,8 +92,10 @@ class TagReport(Report):
self._lv = menu.get_option_by_name('living_people').get_value()
for (value, description) in living_opt.get_items(xml_items=True):
if value == self._lv:
self.living_desc = '(%s)' % self._(description)
living_desc = self._(description)
break
self.living_desc = self._("(Living people: %(option_name)s)"
% {'option_name': living_desc})
self.tag = menu.get_option_by_name('tag').get_value()
if not self.tag: