JMSTranslationBundle icon indicating copy to clipboard operation
JMSTranslationBundle copied to clipboard

Trailing whitespaces in twig

Open loconox opened this issue 9 years ago • 1 comments

Hi,

Here is my issue. I have a twig template with translations. My IDE (phpstorm) indents my template like this :

                class="fos_comment_comment_reply_show_form">{% trans from 'FOSCommentBundle' %}
            fos_comment_comment_show_reply{% endtrans %}</button>

As you can sse there are lots of trailing whitespaces in the trans tag. The translation system removes the trailing spaces and consider the translation tag "fos_comment_comment_show_reply" but the bundle parse this file a create a tag with whitespaces, like this :

<trans-unit id="bd06b49f4a656b9032c3c0caa79c942c72757a3a" resname="            fos_comment_comment_show_reply">
        <source>            fos_comment_comment_show_reply</source>
        <target state="new">            fos_comment_comment_show_reply</target>
</trans-unit>

I think the bundle should remove trailing whitespaces from twig tags.

Regards.

loconox avatar Sep 15 '15 13:09 loconox

I know it was a long time ago you posted this issue. Do you still experiencing this? Or is it fixed in the latest version of the bundle?

Nyholm avatar Aug 04 '16 16:08 Nyholm