Day and month does not follow locale setting

To my knowledge, all functions of the Jinja2 templating language (and python) default to English (and don’t adapt to the operating system’s locale setting).

Your template will need to use mapping to translate ordinal day/month values to day/month names.

{{ "%s %d %s %d à %02d:%d" %
   (["Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dimanche"][now().weekday()],
   now().day,
   ["Janvier","Fevrier","Mars","Avril","Mai","Juin","Juillet","Aout","Septembre","Octobre","Novembre","Decembre"][now().month-1],
   now().year,
   now().hour,
   now().minute) }}

Example

1 Like