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

[Suggestion] A command to set <target> the same as <source> if <target> is empty on the default locale

Open lsv opened this issue 5 years ago • 2 comments

On a whole new project, if you use the extract command, all the <target> tags are empty, even on the default locale.

Wouldnt it be nice to have a command that fills the <target> if it is empty, so your project is not complety blank.

Example

<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en" trgLang="en">
<file id="menu.en">
<unit id="rvfeKNU" name="Server">
      <notes>
        <note category="file-source" priority="1">src/Menu/Builder.php:83</note>
        <note category="state" priority="1">new</note>
      </notes>
      <segment>
        <source>Server</source>
        <target></target>
      </segment>
    </unit>
    <unit id="SE0_pCi" name="Ip Address">
      <notes>
        <note category="file-source" priority="1">src/Menu/Builder.php:89</note>
        <note category="state" priority="1">new</note>
      </notes>
      <segment>
        <source>Ip Address</source>
        <target></target>
      </segment>
    </unit>
  </file>
</xliff>

lsv avatar Nov 21 '18 23:11 lsv

Hi, I am searching something similar. When executing translation:extract new translations target created with source. ¿Have you found the way?

h3llr4iser avatar Oct 30 '19 14:10 h3llr4iser

Probably an additional argument to the command might help here, e.g. bin/console translation:extract --no-empty-target, something like this?

bocharsky-bw avatar Nov 04 '19 08:11 bocharsky-bw