Reputation: 2862
I've a Django project where I'm trying to render the month name inside a template with the date
template tag.
In my settings.py
I've the following because this app runs in Colombia (should be in spanish)
LANGUAGE_CODE = 'es-CO'
USE_L10N = True
In the template I'm trying to format the date this way:
{{ car.expiration_date|date:'F' }}
According with the documentation the F
returns the month's full name and that's true but is coming in english instead of spanish.
I have other Django projects working properly with these settings but I can't find the reason because this one isn't.
Upvotes: 2
Views: 2691
Reputation: 2184
If you have no other way of setting the language code for this particular template, you could try to render the date in your email templateby switching to the right language:
{% load i18n %}
{% language 'es-co' %} {{ car.expiration_date|date:'F' }} {% endlanguage %}
See documentation
Upvotes: 1
Reputation: 5496
Have you tried:
This in a view somewhere or in the Django shell just to to be sure:
from django.conf import settings
print settings.LANGUAGE_CODE
print settings. …
Upvotes: 0