Use French locale for dates

This commit is contained in:
Yohan Boniface 2019-04-02 19:55:02 +02:00
parent 782c08d5ee
commit 1601719b9a
2 changed files with 4 additions and 1 deletions

View file

@ -55,7 +55,7 @@ env = Environment(
def date_filter(value): def date_filter(value):
return value.strftime("%d/%m/%Y") return value.strftime("%d %B")
def time_filter(value): def time_filter(value):

View file

@ -1,3 +1,4 @@
import locale
import os import os
from pathlib import Path from pathlib import Path
@ -11,6 +12,7 @@ SMTP_PASSWORD = ""
SMTP_LOGIN = "" SMTP_LOGIN = ""
FROM_EMAIL = "copanier@epinamap.org" FROM_EMAIL = "copanier@epinamap.org"
STAFF = ["yohanboniface@free.fr", "anne.mattler@wanadoo.fr"] STAFF = ["yohanboniface@free.fr", "anne.mattler@wanadoo.fr"]
LOCALE = "fr_FR.UTF-8"
def init(): def init():
@ -20,6 +22,7 @@ def init():
typ = type(value) typ = type(value)
if env_key in os.environ: if env_key in os.environ:
globals()[key] = typ(os.environ[env_key]) globals()[key] = typ(os.environ[env_key])
locale.setlocale(locale.LC_ALL, LOCALE)
init() init()