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

Bug: xliff file-source is truncated at the beginning

Open allan-simon opened this issue 3 years ago • 1 comments

When I run the command bin/console translation:extract app

I got in the xliff file

    <unit id="0f6q9sX" name="The first name cannot be more than 255 characters.">
      <notes>
        <note category="file-source" priority="1">agrant/src/Entity/Employee.php:0</note>
      </notes>
      <segment>
        <source>The first name cannot be more than 255 characters.</source>
        <target></target>
      </segment>
    </unit>

while it should be /vagrant/src/Entity/Employee.php , the issue seems to be there https://github.com/php-translation/symfony-bundle/blob/master/Service/Importer.php#L136

as my project_root is detected as / so / is 1 in length , with the +1 done, the /v is removed

allan-simon avatar Nov 03 '22 16:11 allan-simon

setting project_root to %kernel.project_dir% solve the issue but I'm not sure if if intented to be used like that ?

allan-simon avatar Nov 03 '22 16:11 allan-simon