[Fixed]-Translating text blocks with Django .. what to do with the HTML?

21๐Ÿ‘

โœ…

I would definitely use blocktrans. Sometimes its not possible to split i18n html text into different fragments. Blocktrans has some powerfull features:

{% url path.to.view arg arg2 as the_url %}

{% blocktrans with object.title as title and author|title as author_t %}

  {{author}}: Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
  Donec quam sem, sodales in fringilla nec, lacinia a lorem. 
  <a href="{{the_url}}">{{title}}</a> molestie ante.

{% endblocktrans %}

Have a look at:

๐Ÿ‘คmaersu

Leave a comment