translation: Croatian

fix inflected long month names
fix dd_dformat04
This commit is contained in:
Josip 2015-06-19 23:44:15 +02:00
parent 6e87ee433c
commit 5a752205b3
2 changed files with 42 additions and 12 deletions

View File

@ -98,6 +98,8 @@ class DateParserHR(DateParser):
# match 'Day. MONTH year.' format with or without dots # match 'Day. MONTH year.' format with or without dots
self._text2 = re.compile('(\d+)?\.?\s*?%s\.?\s*((\d+)(/\d+)?)?\s*\.?$' self._text2 = re.compile('(\d+)?\.?\s*?%s\.?\s*((\d+)(/\d+)?)?\s*\.?$'
% self._mon_str, re.IGNORECASE) % self._mon_str, re.IGNORECASE)
# match Day.Month.Year. # match Day.Month.Year.
self._numeric = re.compile( self._numeric = re.compile(
"((\d+)[/\. ])?\s*((\d+)[/\.])?\s*(\d+)\.?$") "((\d+)[/\. ])?\s*((\d+)[/\.])?\s*(\d+)\.?$")
@ -141,7 +143,13 @@ class DateDisplayHR(DateDisplay):
def dd_dformat04(self, date_val, inflect, long_months): def dd_dformat04(self, date_val, inflect, long_months):
""" """
day month_name year day month_name year
this must agree with DateDisplayEn's "formats" definition
(it may be overridden if a locale-specific date displayer exists)
""" """
print('LONGMONTH: ', long_months)
_ = self._locale.translation.sgettext
year = self._slash_year(date_val[2], date_val[3]) year = self._slash_year(date_val[2], date_val[3])
if date_val[0] == 0: if date_val[0] == 0:
if date_val[1] == 0: if date_val[1] == 0:
@ -149,12 +157,34 @@ class DateDisplayHR(DateDisplay):
else: else:
return self.format_long_month_year(date_val[1], year, return self.format_long_month_year(date_val[1], year,
inflect, long_months) inflect, long_months)
elif date_val[1] == 0: # month is zero but day is not (see 8477)
return self.display_iso(date_val)
else: else:
return "{day:d}. {long_month.f[G]} {year}.".format( # TRANSLATORS: this month is ALREADY inflected: ignore it
return _("{day:d} {long_month} {year}").format(
day = date_val[0], day = date_val[0],
long_month = long_months[date_val[1]], long_month = self.format_long_month(date_val[1],
inflect, long_months).replace('.', ''),
year = year) year = year)
# def dd_dformat04(self, date_val, inflect, long_months):
# """
# day month_name year
# """
# year = self._slash_year(date_val[2], date_val[3])
# if date_val[0] == 0:
# if date_val[1] == 0:
# return year + '.'
# else:
# return self.format_long_month_year(date_val[1], year,
# inflect, long_months)
# else:
# return "{day:d} {long_month} {year}".format(
# day = date_val[0],
# long_month = long_months[date_val[1]],
# year = year)
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Register classes # Register classes

View File

@ -9,7 +9,7 @@ msgstr ""
"Project-Id-Version: Gramps 4.2\n" "Project-Id-Version: Gramps 4.2\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-06-07 20:07+0200\n" "POT-Creation-Date: 2015-06-07 20:07+0200\n"
"PO-Revision-Date: 2015-06-14 20:01+0100\n" "PO-Revision-Date: 2015-06-19 23:37+0100\n"
"Last-Translator: josip <josip@pisoj.com>\n" "Last-Translator: josip <josip@pisoj.com>\n"
"Language-Team: \n" "Language-Team: \n"
"Language: hr\n" "Language: hr\n"