diff --git a/gestion/mail/mail.py b/gestion/mail/mail.py index e7abb26f..64fcdc24 100644 --- a/gestion/mail/mail.py +++ b/gestion/mail/mail.py @@ -6,6 +6,7 @@ import jinja2 import sys import json import inspect +import locale from email.header import Header from email.message import Message @@ -28,7 +29,14 @@ text_mutilang_template = template_path + 'text_multilang' templateLoader = jinja2.FileSystemLoader( searchpath=["/", template_path] ) templateEnv = jinja2.Environment( loader=templateLoader ) -templateEnv.filters['date'] = lambda d: d.strftime('%d %B %Y') + +def format_date(d): + if 'fr_FR' in locale.getlocale(): + return d.strftime('%A %d %B %Y') + else: + return d.strftime('%A, %B %d %Y') + +templateEnv.filters['date'] = format_date # file extension to rendering function map