I.e., with `end` a `datetime` object obtained with `timezone.now() +
timedelta(days=21)`:
{{{
{% load i18n l10n humanize %}
{% get_current_language as LANGUAGE_CODE %}
{{ LANGUAGE_CODE }}, {{ end }}, {{ end|timeuntil }}, {{ end|naturaltime
}}, {% trans "Password" %}
}}}
returns:
`es_ES, Oct. 20, 2014, 3:30 p.m., 2 weeks, 6 days, 2 weeks, 6 days a
partir de ahora, Contraseña`
So the localization is working, but those filters do not seem to use it.
See attached project for a working version of this example.
--
Ticket URL: <https://code.djangoproject.com/ticket/23568>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Can you try using the "es" as language code in your settings instead of
es_ES? This is what django uses [1].
IIRC, gettext will fallback to English, if it cannot find the files that
correspond to the correct locale, which could explain the weird behavior
here.
The code looks correct to me with a quick look.
[1]: https://github.com/django/django/tree/master/django/conf/locale/es
--
Ticket URL: <https://code.djangoproject.com/ticket/23568#comment:1>
Comment (by lerela):
Same thing. The point of my example is that "regular" strings do get
translated (I don't have any project-specific locale file to translate
"password", this is Django's translation), so it is able to find the
locale files.
--
Ticket URL: <https://code.djangoproject.com/ticket/23568#comment:2>
* status: new => closed
* resolution: => invalid
Comment:
Turned out I did not realize I was still using RC2. 1.7 does not have this
bug, even though I don't know when/where it has been solved. Sorry.
--
Ticket URL: <https://code.djangoproject.com/ticket/23568#comment:3>