diff --git a/gramps/plugins/drawreport/statisticschart.py b/gramps/plugins/drawreport/statisticschart.py index 6bd5fa884..f631ffcb6 100644 --- a/gramps/plugins/drawreport/statisticschart.py +++ b/gramps/plugins/drawreport/statisticschart.py @@ -421,7 +421,7 @@ class Extract: if date: year = date.get_year() if year: - return [self._get_date(Date(year))] # localized year + return [str(year)] return [_T_("Date(s) missing")] def get_month(self, event): @@ -672,7 +672,6 @@ class Extract: self._locale = rlocale self._ = rlocale.translation.sgettext self._get_type = rlocale.get_type - self._get_date = rlocale.get_date data = [] ext = self.extractors @@ -789,12 +788,21 @@ class StatisticsChart(Report): else: genders = None + # needed for keyword based localization + mapping = { + 'genders': genders, + 'year_from': year_from, + 'year_to': year_to + } + if genders: - span_string = self._("%s born") % genders + span_string = self._("%(genders)s born " + "%(year_from)04d-%(year_to)04d" + ) % mapping else: - span_string = self._("Persons born") - span_string += " %s-%s" % (self._get_date(Date(year_from)), # localized - self._get_date(Date(year_to))) + span_string = self._("Persons born " + "%(year_from)04d-%(year_to)04d" + ) % mapping people = self.filter.apply(self.database, self.database.iter_person_handles(), diff --git a/gramps/plugins/graph/gvfamilylines.py b/gramps/plugins/graph/gvfamilylines.py index 5507558ea..d594daf67 100644 --- a/gramps/plugins/graph/gvfamilylines.py +++ b/gramps/plugins/graph/gvfamilylines.py @@ -49,7 +49,7 @@ LOG = logging.getLogger(".FamilyLines") #------------------------------------------------------------------------ from gramps.gen.const import GRAMPS_LOCALE as glocale _ = glocale.translation.gettext -from gramps.gen.lib import EventRoleType, EventType, Person, PlaceType +from gramps.gen.lib import EventRoleType, EventType, Person, PlaceType, Date from gramps.gen.utils.file import media_path_full from gramps.gen.utils.thumbnails import (get_thumbnail_path, SIZE_NORMAL, SIZE_LARGE) @@ -811,7 +811,8 @@ class FamilyLinesReport(Report): if bth_event and self._incdates: date = bth_event.get_date_object() if self._just_years and date.get_year_valid(): - birth_str = '%i' % date.get_year() + birth_str = self._get_date( # localized year + Date(date.get_year())) else: birth_str = self._get_date(date) @@ -826,7 +827,8 @@ class FamilyLinesReport(Report): if dth_event and self._incdates: date = dth_event.get_date_object() if self._just_years and date.get_year_valid(): - death_str = '%i' % date.get_year() + death_str = self._get_date( # localized year + Date(date.get_year())) else: death_str = self._get_date(date) @@ -953,7 +955,8 @@ class FamilyLinesReport(Report): if self._incdates: date = event.get_date_object() if self._just_years and date.get_year_valid(): - wedding_date = '%i' % date.get_year() + wedding_date = self._get_date( # localized year + Date(date.get_year())) else: wedding_date = self._get_date(date) # get the wedding location diff --git a/gramps/plugins/graph/gvrelgraph.py b/gramps/plugins/graph/gvrelgraph.py index 04b695b57..aa5f6749b 100644 --- a/gramps/plugins/graph/gvrelgraph.py +++ b/gramps/plugins/graph/gvrelgraph.py @@ -54,7 +54,7 @@ from gramps.gen.plug.report import Report from gramps.gen.plug.report import utils from gramps.gen.plug.report import MenuReportOptions from gramps.gen.plug.report import stdoptions -from gramps.gen.lib import ChildRefType, EventRoleType, EventType +from gramps.gen.lib import ChildRefType, EventRoleType, EventType, Date from gramps.gen.utils.file import media_path_full, find_file from gramps.gen.utils.thumbnails import get_thumbnail_path from gramps.gen.relationship import get_relationship_calculator @@ -718,7 +718,8 @@ class RelGraphReport(Report): event_date = event.get_date_object() if event_date.get_year_valid(): if self.event_choice in [4, 5]: - return '%i' % event_date.get_year() + return self._get_date( # localized year + Date(event_date.get_year())) elif self.event_choice in [1, 2, 3, 7]: return self._get_date(event_date) return '' diff --git a/gramps/plugins/webreport/webcal.py b/gramps/plugins/webreport/webcal.py index 94fa94878..564884ddd 100644 --- a/gramps/plugins/webreport/webcal.py +++ b/gramps/plugins/webreport/webcal.py @@ -708,7 +708,8 @@ class WebCalReport(Report): th_txt = month_name if cal == 'wc': # webcalendar() if not self.multiyear: - th_txt = '%s %04d' % (month_name, year) + th_txt = '%s %s' % (month_name, + self._get_date(Date(year))) # localized # begin calendar table and table head with Html("table", class_="calendar",