PHP: HTML inside gettext function string
gettext, html, php
Solution
Both would work okay, gettext does not string anything out of the messags. You might however want to not include HTML in translations to make translators life easier - it is easier to just translate string and don't have to care about HTML markup. Of course sometimes it is not really possible...
Problem
I'm somewhat of confused. As far as I knew every text in a gettext function is used as msgid So this one: ``` _("My long text that I <br> because I need to ") ``` should be: ``` #: htdocs/index.php:8 msgid "My long text that I <br> because I need to" msgstr "Translation needs different <br> inside because russian is different" ``` I just can't find any documentation that gettext() or _() strips html tags out. Should I be replacing it like this? And why? ``` sprintf(_("My long text that I %s because I need to "), '<br>') ```