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
- Other translation block by cecedille1 2 years ago
- i18n base model for translatable content by foxbunny 4 years, 10 months ago
- Extended i18n base model by alcinnz 1 month, 1 week ago
- Custom Template Tag - No Translate by robcharlwood 3 years, 1 month ago
- Multilingual Models by Archatas 6 years, 2 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.
#