translation: Croatian
This commit is contained in:
parent
2ae2ca5c7d
commit
60c0843861
@ -70,25 +70,43 @@ class DateParserHR(DateParser):
|
|||||||
bce = ["prije nove ere", "prije Krista",
|
bce = ["prije nove ere", "prije Krista",
|
||||||
"p.n.e."] + DateParser.bce
|
"p.n.e."] + DateParser.bce
|
||||||
|
|
||||||
|
# def init_strings(self):
|
||||||
|
# """
|
||||||
|
# compiles regular expression strings for matching dates
|
||||||
|
# """
|
||||||
|
# DateParser.init_strings(self)
|
||||||
|
# #~ DateParser.calendar_to_int.update({
|
||||||
|
# #~ 'персидский' : Date.CAL_PERSIAN,
|
||||||
|
# #~ 'п' : Date.CAL_PERSIAN,
|
||||||
|
# #~ })
|
||||||
|
# _span_1 = ['od']
|
||||||
|
# _span_2 = ['do']
|
||||||
|
# _range_1 = ['između']
|
||||||
|
# _range_2 = ['i']
|
||||||
|
# self._span = re.compile("(%s)\s+(?P<start>.+)\s+(%s)\s+(?P<stop>.+)" %
|
||||||
|
# ('|'.join(_span_1), '|'.join(_span_2)),
|
||||||
|
# re.IGNORECASE)
|
||||||
|
# self._range = re.compile("(%s)\s+(?P<start>.+)\s+(%s)\s+(?P<stop>.+)" %
|
||||||
|
# ('|'.join(_range_1), '|'.join(_range_2)),
|
||||||
|
# re.IGNORECASE)
|
||||||
|
|
||||||
def init_strings(self):
|
def init_strings(self):
|
||||||
"""
|
"""
|
||||||
compiles regular expression strings for matching dates
|
compiles regular expression strings for matching dates
|
||||||
"""
|
"""
|
||||||
DateParser.init_strings(self)
|
DateParser.init_strings(self)
|
||||||
#~ DateParser.calendar_to_int.update({
|
# match 'Day. MONTH year.' format with or without dots
|
||||||
#~ 'персидский' : Date.CAL_PERSIAN,
|
self._text2 = re.compile('(\d+)?\.?\s*?%s\.?\s*((\d+)(/\d+)?)?\s*\.?$'
|
||||||
#~ 'п' : Date.CAL_PERSIAN,
|
% self._mon_str, re.IGNORECASE)
|
||||||
#~ })
|
# match Day.Month.Year.
|
||||||
_span_1 = ['od']
|
self._numeric = re.compile(
|
||||||
_span_2 = ['do']
|
"((\d+)[/\. ])?\s*((\d+)[/\.])?\s*(\d+)\.?$")
|
||||||
_range_1 = ['između']
|
#"((\d+)[/\.]\s*)?((\d+)[/\.]\s*)?(\d+)\s*$")
|
||||||
_range_2 = ['i']
|
self._span = re.compile(
|
||||||
self._span = re.compile("(%s)\s+(?P<start>.+)\s+(%s)\s+(?P<stop>.+)" %
|
"(od)\s+(?P<start>.+)\s+(do)\s+(?P<stop>.+)",
|
||||||
('|'.join(_span_1), '|'.join(_span_2)),
|
re.IGNORECASE)
|
||||||
re.IGNORECASE)
|
self._jtext2 = re.compile('(\d+)?.?\s+?%s\s*((\d+)(/\d+)?)?'\
|
||||||
self._range = re.compile("(%s)\s+(?P<start>.+)\s+(%s)\s+(?P<stop>.+)" %
|
% self._jmon_str, re.IGNORECASE)
|
||||||
('|'.join(_range_1), '|'.join(_range_2)),
|
|
||||||
re.IGNORECASE)
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -105,6 +123,38 @@ class DateDisplayHR(DateDisplay):
|
|||||||
|
|
||||||
display = DateDisplay.display_formatted
|
display = DateDisplay.display_formatted
|
||||||
|
|
||||||
|
def dd_dformat01(self, date_val):
|
||||||
|
"""
|
||||||
|
numerical
|
||||||
|
"""
|
||||||
|
if date_val[3]:
|
||||||
|
return self.display_iso(date_val)
|
||||||
|
else:
|
||||||
|
if date_val[0] == date_val[1] == 0:
|
||||||
|
return str(date_val[2]) + '.'
|
||||||
|
else:
|
||||||
|
value = self._tformat.replace('%m', str(date_val[1]))
|
||||||
|
value = value.replace('%d', str(date_val[0]))
|
||||||
|
value = value.replace('%Y', str(abs(date_val[2])))
|
||||||
|
return value
|
||||||
|
|
||||||
|
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.f[G]} {year}.".format(
|
||||||
|
day = date_val[0],
|
||||||
|
long_month = long_months[date_val[1]],
|
||||||
|
year = year)
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Register classes
|
# Register classes
|
||||||
|
@ -186,6 +186,8 @@ except:
|
|||||||
'10/25/2005' : '%m/%d/%Y',
|
'10/25/2005' : '%m/%d/%Y',
|
||||||
'2005/10/25' : '%Y/%m/%d',
|
'2005/10/25' : '%Y/%m/%d',
|
||||||
'25.10.2005' : '%d.%m.%Y',
|
'25.10.2005' : '%d.%m.%Y',
|
||||||
|
'25.10.2005.' : '%d.%m.%Y.',
|
||||||
|
'25. 10. 2005.' : '%d. %m. %Y.',
|
||||||
'10.25.2005' : '%m.%d.%Y',
|
'10.25.2005' : '%m.%d.%Y',
|
||||||
'2005.10.25' : '%Y.%m.%d',
|
'2005.10.25' : '%Y.%m.%d',
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user