1 2 3 4 5 6 7 8 9 | from django.utils.translation import ugettext
from django import template
register = template.Library()
def do_ugettext(msg):
"""Returns the gettext translation of the given message"""
return ugettext(msg)
register.simple_tag('ugettext', do_ugettext)
|
More like this
- TaggedManager and TaggedQuerySet with chainable tagged() methods implemented with django-tagging by fish2000 1 year, 11 months ago
- Duplicating Template Tag by skarphace 5 months ago
- Sanitize HTML filter with tag/attribute whitelist and XSS protection by harrym 2 years, 6 months ago
- Cloud Tag template example by ramdas 4 years, 2 months ago
- Make tags easier with properties by ubernostrum 4 years, 11 months ago
Comments
That might be a dumb question, but how is this different from using that standard {%trans "some message" %} ?
#
It's smaller, doesn't use a Node subclass and doesn't force me to load the whole i18n tag lib.
#