#5025: Add a "truncate" template filter
---------------------------------------+---------------------------------
               Reporter:  SmileyChris  |          Owner:  nobody
                   Type:  New feature  |         Status:  reopened
              Milestone:               |      Component:  Template system
                Version:  SVN          |       Severity:  Normal
             Resolution:               |       Keywords:
           Triage Stage:  Accepted     |      Has patch:  1
    Needs documentation:  0            |    Needs tests:  0
Patch needs improvement:  1            |  Easy pickings:  0
---------------------------------------+---------------------------------
Changes (by jezdez):

 * needs_better_patch:  0 => 1


Comment:

 A few things:

 - Use `pgettext_lazy` instead of `ugettext_lazy` to give the rather
 ambiguous string `'...'` some context. (e.g.
 `end_text=pgettext_lazy('truncatechars end text', '...')`. This will
 explain the translators better what this is about.
 - The naming of `truncate_chars` and `truncatechars` seems weird. How does
 `truncate_chars` relate to `truncate_words`? Can they be combined? Why
 isn't the `truncate` filter extended in the first place?
 - Don't use inline imports in the template filter.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/5025#comment:32>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to