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
This commit is contained in:
Paul Franklin 2018-10-07 23:45:40 -07:00
parent 15db2dd603
commit 7da8811327

View File

@ -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(),