php-translation / symfony-bundle

Symfony integration for Translations
MIT License
327 stars 93 forks source link

Xliff file source notes don't use the same directory separator in Windows and *nix #265

Open maartendekeizer opened 6 years ago

maartendekeizer commented 6 years ago

When extracting on Windows a backslash is used.

    <unit id="....">
      <notes>
        <note category="file-source" priority="1">templates\example.html.twig:12</note>
      </notes>
...
    </unit>

When extracting on Linux a forwardslash is used.

    <unit id="....">
      <notes>
        <note category="file-source" priority="1">templates/example.html.twig:12</note>
      </notes>
...
    </unit>

When working together one person on *nix and another one on Windows this results in a lot of unnecessary changes in the translation files.

My suggestion is to always use forward slashes ore make this configurable and add the conversion in Service/Importer.php.

Is there support for this change and should I create a PR for it?

odolbeau commented 4 years ago

Hi @maartendekeizer & thanks for this issue. Sorry for the (very long) delay. :(

Don't hesitate to create a PR! IMO your first proposition is great: forcing *nix escaping even for Windows users.