Filter to extend an XLIFF file with <target> tag

Dear experts,

I´ve an XLIFF file to translate. This file contains only <source></source> tag, but NO <target></target> tag. My customer expect the translated segments in the <target></target>segment, which the filter somehow should magically include into the text. Is it possible to extend the target document with a <target> segment?

Source File contains only source tag:
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
    <file source-language="de" target-language="en" datatype="plaintext" original="file.ext">
        <body>
            <trans-unit id="asp_help_text" resname="asp_help_text">
                <source xml:lang="de">Hilfe</source>
             </trans-unit>
            <trans-unit id="asp_contact_text" resname="asp_contact_text">
                <source xml:lang="de">Kontakt</source>
             </trans-unit>
        </body>
    </file>
</xliff>
-----------------------------------------------------
Expected Translation extended with target tags:
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
    <file source-language="de" target-language="en" datatype="plaintext" original="file.ext">
        <body>
            <trans-unit id="asp_help_text" resname="asp_help_text">
                <source xml:lang="de">Hilfe</source>                
                <target xml:lang="en">Help</target>
             </trans-unit>
            <trans-unit id="asp_contact_text" resname="asp_contact_text">
                <source xml:lang="de">Kontakt</source>
                <target xml:lang="en">Contakt</target>
             </trans-unit>
        </body>
    </file>
</xliff>

 

Thanks a lot!

Parents Reply Children
  • Dear Sebstien,
    thanks for your reply, but I do not have any <target> element in the file. I only receive a file like that:
    Source File contains only source tag, but NO target tag:
    <?xml version="1.0" encoding="utf-8"?>
    <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
    <file source-language="de" target-language="en" datatype="plaintext" original="file.ext">
    <body>
    <trans-unit id="asp_help_text" resname="asp_help_text">
    <source xml:lang="de">Hilfe</source>
    </trans-unit>
    <trans-unit id="asp_contact_text" resname="asp_contact_text">
    <source xml:lang="de">Kontakt</source>
    </trans-unit>
    </body>
    </file>
    </xliff>

     

    I did try to translate this document and the translation did replace the text in <source> </source> tag. I still did not get any <target> element. Any ideas?

    Thanks!

  • Hello Edit,
    can you see which file type has been used to prepare the file? What is the extension of your file?
    The behavior you describe is the behavior of the xml filetype which detects text, prepare it and replace the source text with the target.
    The xliff file type behavior does not overwrite the source elements but creates the target tags you need at the same level as the target elements inside the trans-unit elements.
    Does this help?
    Kind regards
    Sébastien