Symfony2: HTML inside translation message

后端 未结 9 1795
醉话见心
醉话见心 2020-12-09 02:12

In messages.en.yml, I have

confirmed: Congrats %username%, your account is now activated.

But I want to \'bold\' username to

9条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-09 02:21

    I've just found something out, you can use this in your YAML file:

        mind: >
            Mind is a nice thing to have
    

    So this ">" sign in the first row achieves it. I think this would be the preferred way, better than handling the escapes etc in TWIG.

    I've looked it up now and it is actually a YAML feature. Check here :)

    Also, there's an earlier question with similar subject: How can I get YAML to ignore raw HTML in same file.

提交回复
热议问题