Thank you for checking my question.
I try to use gettext and serve my django website in another languages.
{% trans "I am a student. <br> I am a man."%}
But as shown below, if you add a class, an error will occur.
{% trans "I am a student. <br class="aaaa"> I am a man."%}
Could you teach me is there any good solution?
You have many possibilities:
div
:<-- in html -->
<div class="aaaa"> {% trans "I am a student. <br> I am a man."%}</ div>
don't forget about css:
.aaaa br {
}
blocktranslate
template tag:more here: https://docs.djangoproject.com/en/4.1/topics/i18n/translation/#std-templatetag-blocktranslate
<div class="aaaa">
{% trans "I am a student."%}
</ div>
<div class="bbb">
{% trans "I am a man."%}
</ div>
i don't like the last solution: if first trans
bounded with second trans
and they should be translated together.