Quantcast
Channel: _() or {% trans %} in Django templates? - Stack Overflow
Browsing latest articles
Browse All 3 View Live

Answer by Anton Strogonoff for _() or {% trans %} in Django templates?

So it seems that there's technically no difference as of Django 1.5. Template engine internally marks a variable for translation (by setting its translate attribute) in two cases:when you do {% trans...

View Article


Answer by gagamil for _() or {% trans %} in Django templates?

The trans template tag calls the ugettext() function. In Django _() is an alias to ugettext().This is covered in the django docs.

View Article

_() or {% trans %} in Django templates?

In Django templates, you can use either {{ _("Hello World") }} or {% trans "Hello World" %} to mark strings to be translated. In docs, the “official” approach seems to be the {% trans %} tag, but the...

View Article
Browsing latest articles
Browse All 3 View Live