diff options
-rw-r--r-- | fietsboek/util.py | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/fietsboek/util.py b/fietsboek/util.py index b56584f..0f9cc5d 100644 --- a/fietsboek/util.py +++ b/fietsboek/util.py @@ -2,6 +2,7 @@ import random import string +import babel import markdown import bleach import gpxpy @@ -83,23 +84,8 @@ def month_name(request, month): :rtype: str """ assert 1 <= month <= 12 - # Explicitely list them so that Babel can extract them - months = [ - _("month.january"), - _("month.february"), - _("month.march"), - _("month.april"), - _("month.may"), - _("month.june"), - _("month.july"), - _("month.august"), - _("month.september"), - _("month.october"), - _("month.november"), - _("month.december"), - ] - our_month = months[month - 1] - return request.localizer.translate(our_month) + locale = babel.Locale.parse(request.localizer.locale_name) + return locale.months["stand-alone"]["wide"][month] def random_alphanum_string(length=20): |