Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django blocktrans - inside HTML tag

Is it possible to put some HTML tag inside this Django block: {% blocktrans %}{% endblocktrans %}?

For example:

{% blocktrans %}Django<br>framework needed{% endblocktrans %} 
like image 529
Balázs Szántó Avatar asked Aug 10 '13 09:08

Balázs Szántó


2 Answers

Certainly, sometimes you even have to use blocktrans template tag actually.

Check:

  • Translating text blocks with Django .. what to do with the HTML?
  • Django templates: Best practice for translating text block with HTML in it
  • https://groups.google.com/forum/#!topic/django-users/j_r6y1VeAag
like image 85
Hieu Nguyen Avatar answered Nov 14 '22 12:11

Hieu Nguyen


From the docs:

HTML markup, however, is common enough that it's probably ok to use in translatable strings. But please bear in mind that the GNU gettext tools don't verify that the translations are well-formed HTML.

like image 7
dan-klasson Avatar answered Nov 14 '22 13:11

dan-klasson