How to force line break in Symfony2 translation file How to force line break in Symfony2 translation file symfony symfony

How to force line break in Symfony2 translation file


Use |

email:    subject: My Subject    message: |        Hello %name%,        This is my second line        Best regards,        John Smith        Customer Care


In your translations file (e.g. messages.en.yml):

your   translation            key:         here: |                Lorem ipsum.                CRMPICCO.                www.crmpicco.co.uk.

Accessing it in your Twig template:

{{ 'your.translation.key.here'|trans|nl2br }}