Quantcast
Channel: _() or {% trans %} in Django templates? - Stack Overflow
Browsing all 3 articles
Browse latest 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 all 3 articles
Browse latest View live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>