Translating month and day names in django templates
I would like to print day names and month names in the currently selected language, but django keeps showing them in english even if language selection is working fine.
In my template:
{{ LANGUAGE_CODE }}
{% localize on %}
{{ day|date:"l" }}
{% endlocalize %}
The result is:
it Friday
I was expecting:
it Venerdì
If I try to show the date with the default format, using this code:
{{ day }}
, the date format correctly changes depending on the currently selected language, but the day or month names are still not localized..
So for example if english is selected, I get April 25th 2025
, while if italian is selected, I get 25th April 2025
. Different date format, but April is always in English.
How can i translate day\month names?
This is my settings.py:
USE_I18N = True
USE_L10N = True
USE_TZ = True