#35333: Template tag `unlocalize` does not work with `date` and `time` filters.
---------------------------------+----------------------------------------
     Reporter:  Natalia Bidart   |                    Owner:  Claude Paroz
         Type:  Bug              |                   Status:  assigned
    Component:  Template system  |                  Version:  dev
     Severity:  Normal           |               Resolution:
     Keywords:                   |             Triage Stage:  Accepted
    Has patch:  0                |      Needs documentation:  0
  Needs tests:  0                |  Patch needs improvement:  0
Easy pickings:  0                |                    UI/UX:  0
---------------------------------+----------------------------------------
Comment (by Claude Paroz):

 I'm not yet sure if this can be resolved in the code, or if we should
 rather complement the template filter docs, telling that if you apply an
 l10n-sensible filter inside an unlocalized section, you should specify an
 explicit format argument. The problem being that the way filters are
 currently implemented, it's not possible to transmit any context. That
 explains for example that `floatformat` gained an `u` parameter to force
 unlocalization (see #30086).

 So in your example in the tests above, you should use
 `|date:settings.DATE_FORMAT` and not just `DATE_FORMAT`. Thoughts?
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35333#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018ed87b9941-ff22e3a6-cd84-4037-a44e-399e1e82e3aa-000000%40eu-central-1.amazonses.com.

Reply via email to