Hi we're using the Twig templating system within our site along with the twig i18n extension to handle our language translations.
As per the documentation, all of our template strings are wrapped in the trans
block to be translated by the extension as shown below:
{% trans "Text to be <br>translated" %}
The issue is that within some of our template strings we have inline <br>
tags for text formatting. In all the instances where these <br>
tags exist, the strings don't translate and remain in English. Is there any way to 'escape' the <br>
tags within a trans
block, so that all the strings are read and translated properly?
You can run it through a nl2br filter as well as the trans filter: