Date filter lang

After date locale (Tera date-locale feature), we could add a language feature. For example:

{{ 1648252203 | date(format="%d %B %Y") }}
{# returns 25 March 2022 #}
{{ 1648252203 | date(format="%d %B %Y", lang="fr") }}
{# could return 25 mars 2022 #}

I don’t know how I would achieve this, but this could be nice for i18n of theming.

[edit] read that here

Chrono now also provides date formatting in almost any language without the help of an additional C library. This functionality is under the feature unstable-locales:

[edit] RTFM

Example: {{ 1648252203 | date(format="%A %-d %B", timezone="Europe/Paris", locale="fr_FR") }}

The locale argument already does this, afaik it only translates weekday and month names. It is distinct from the preexisting timezone argument. Are you talking about something else?

I find the wording “locale” misleading and prefer “lang”, but “locale” looks more conventional for this usage, and it’s the name of the chrono feature.

1 Like

Je vais supprimer suite à mon RTFM :wink: [edit] je peux pas
et en plus ça a l’air de par marcher :confused:

1 Like