symfony-bundle icon indicating copy to clipboard operation
symfony-bundle copied to clipboard

Distorted saving of translations due to comma sign

Open byhaskell opened this issue 5 years ago • 0 comments

Hello. Thanks for the great bundle, I work with it all the time. The only problem that surprises me is if there is a comma in the text - there is duplication and, as a result, the translation is not applied.

Ways to get the error: In the code, such a call to the translator:

$translator->trans('The customer is not attached to the order, which is needed to generate an invoice', ['%field%' => 'order']);

Action screenshot: https://prnt.sc/xfb0h6 After pressing the button, an incorrect saving is already taking place, since "name" is not correct:


    <unit id="QBJm1Gn" name="e586199">
      <segment>
        <source>The customer is not attached to the order, which is needed to generate an invoice</source>
        <target>The customer is not attached to the order, which is needed to generate an invoice</target>
      </segment>
    </unit>

Due to the incorrect name, after pressing the "Save" button, another translation block is added to the translation file.

    <unit id="UNxsRki" name="e586199">
      <segment>
        <source>e586199</source>
        <target>The customer is not attached to the order, which is needed to generate an invoice</target>
      </segment>
    </unit>

If you exclude the comma symbol, everything is fine. Hope for a fix. Thank you.

byhaskell avatar Jan 22 '21 07:01 byhaskell