From 7da88113278f20c473a167b646969b1b2bb3cd7f Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Sun, 7 Oct 2018 23:45:40 -0700 Subject: [PATCH] Setting the year as an ordinal number in Croatian With this commit, the "master" version of the Statistics Chart report will show a year as an ordinal number in Croatian. So our translators will have until 5.1.0 is released to translate the two new strings, in all the supported gramps languages. Issue #10822 --- gramps/plugins/drawreport/statisticschart.py | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/gramps/plugins/drawreport/statisticschart.py b/gramps/plugins/drawreport/statisticschart.py index f631ffcb6..6bd5fa884 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 [str(year)] + return [self._get_date(Date(year))] # localized year return [_T_("Date(s) missing")] def get_month(self, event): @@ -672,6 +672,7 @@ 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 @@ -788,21 +789,12 @@ 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._("%(genders)s born " - "%(year_from)04d-%(year_to)04d" - ) % mapping + span_string = self._("%s born") % genders else: - span_string = self._("Persons born " - "%(year_from)04d-%(year_to)04d" - ) % mapping + span_string = self._("Persons born") + span_string += " %s-%s" % (self._get_date(Date(year_from)), # localized + self._get_date(Date(year_to))) people = self.filter.apply(self.database, self.database.iter_person_handles(),