Fix Russian date handler crash when Russian .po isn't present

Fixes #10855
This commit is contained in:
prculley 2018-10-24 10:11:01 -05:00 committed by Nick Hall
parent e8679a1eed
commit 88373c0eb6

View File

@ -132,6 +132,11 @@ class DateDisplayRU(DateDisplay):
inflect, long_months)
elif date_val[1] == 0: # month is zero but day is not (see 8477)
return self.display_iso(date_val)
elif not hasattr(long_months[date_val[1]], 'f'): # not a Lexeme
return "{day:d} {long_month} {year}".format(
day = date_val[0],
long_month = long_months[date_val[1]],
year = year)
else:
return "{day:d} {long_month.f[Р]} {year}".format(
day = date_val[0],
@ -151,6 +156,11 @@ class DateDisplayRU(DateDisplay):
inflect, short_months)
elif date_val[1] == 0: # month is zero but day is not (see 8477)
return self.display_iso(date_val)
elif not hasattr(short_months[date_val[1]], 'f'): # not a Lexeme
return "{day:d} {short_month} {year}".format(
day = date_val[0],
short_month = short_months[date_val[1]],
year = year)
else:
return "{day:d} {short_month.f[Р]} {year}".format(
day = date_val[0],