From 88373c0eb634df4dd047562c9ce1d0ede98f6cea Mon Sep 17 00:00:00 2001 From: prculley Date: Wed, 24 Oct 2018 10:11:01 -0500 Subject: [PATCH] Fix Russian date handler crash when Russian .po isn't present Fixes #10855 --- gramps/gen/datehandler/_date_ru.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gramps/gen/datehandler/_date_ru.py b/gramps/gen/datehandler/_date_ru.py index 3682247fd..9437c34ff 100644 --- a/gramps/gen/datehandler/_date_ru.py +++ b/gramps/gen/datehandler/_date_ru.py @@ -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],