Thanks to visit codestin.com
Credit goes to github.com

Skip to content

XLIFF translates to blank if target tag is not set #15788

Closed
@janit

Description

@janit

Transifex (https://www.transifex.com) and possibly other tools create XLIFF like this for missing translations:

      <trans-unit id="758ec54e430e8ea2e6a1b38b60597aceb1991dc6" resname="Cash">
        <source>Cash</source>

        <jms:reference-file line="38">default/foo/bar.html.twig</jms:reference-file>
      </trans-unit>

This is missing the <target>Cash</target> tag if "Cash" is not translated. Rendering this with

<h1>{% trans %}Cash{% endtrans %}</h1>

Generates a blank output

<h1></h1>

where I would expect it to return the value of <source> if <target> is not defined.

Is this a mismatch in implementation of XLIFF or a conscious decision?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions