Search code examples
symfonytwigtranslation

Symfony2 twig translate string containing colon


How can I translate string containing colon in symfony2 using twig? Here's what I have:

Inside twig template:

{% trans with {'%order_no%': order_no} %}Loading offer: %order_no%...{% endtrans %}

Inside translation file:

Loading offer: %order_no%...: Įkeliamas užsakymas %order_no%...

As expected this doesn't work. How can I make it work?


Solution

  • You need to use quotes around the text as such:

    'Loading offer: %order_no%...': Įkeliamas užsakymas %order_no%...
    

    edited to show the correct example.