Symfony2: HTML inside translation message
symfony
Solution
Update 2
In such cases, I started to use like this:
confirmed: Congrats %start_link%%username%%end_link%, your account is now activated
Since separation of concerns is maintained, this way is strongly recommended.
Update
In YAML, I have used translations like this without any problem:
trans.key: click <a href="%url%">here</a> to continue
Although translations and design should be kept separated there are always some situations that you must use html tags inside translation files as it is also seen in huge projects like Facebook and Twitter.
In such situations, you can use XLIFF format which is being recommended by Symfony. Inside translation file:
<trans-unit id="1">
<source>confirmed</source>
<target>Congrats <![CDATA[<span class='bold'>%username%</span>]]> , your account is now activated.</target>
</trans-unit>
Problem
In `messages.en.yml`, I have ``` confirmed: Congrats %username%, your account is now activated. ``` But I want to 'bold' username to example ... how can I made this ? ``` confirmed: Congrats <span class='bold'>%username%</span>, your account is now activated. ``` Of course I could use two sentence in this example like ``` first: Congrats second: , your account ... ``` and inside twig use the html tag but this seems very dirty.