"Ignorable" element in xliff target file

Hello, I've experienced a particular problem when translating an XLIFF file within Studio. A source came in with two sentences in one specific segment. Translation showed two different sentences in two different segments. After generating the target file and delivering it to the customer, the sentences are not re-joint/merged together in one segment(//source) as I would have expected, but remain split, with an <ignorable> element in between. Any idea how to avoid this? Is it a setting? I've never heard of this 'ignorable' element before, what is it exactly? Thanks.

  • I created a file like this:

    <?xml version="1.0" encoding="utf-8"?>
    <xliff version="1.2" >
      <file original='somefile.txt' source-language="en-GB" target-language="de-DE" datatype='plaintext' >
        <header>
          <note>simple xliff</note>
        </header>
        <body>
         <trans-unit id="1">
          <source>First sentence. Second sentence</source>
          <target></target>
         </trans-unit>
         <trans-unit id="2">
          <source>Third sentence</source>
          <target></target>
         </trans-unit>
        </body>
      </file>
    </xliff>

    Opened in Studio and copied source to target like this:

    Screenshot of Trados Studio showing two translation units with source text copied to target text, no visible errors or warnings.

    Then saved the target file and get this:

    <?xml version="1.0" encoding="utf-8"?>
    <xliff version="1.2">
      <file original="somefile.txt" source-language="en-GB" target-language="de-DE" datatype="plaintext">
        <header>
          <note>simple xliff</note>
        </header>
        <body>
         <trans-unit id="1">
          <source>First sentence. Second sentence</source>
          <target state="new">First sentence. Second sentence</target>
         </trans-unit>
         <trans-unit id="2">
          <source>Third sentence</source>
          <target state="new">Third sentence</target>
         </trans-unit>
        </body>
      </file>
    </xliff>

    Which all looks correct to me.

    So, if you can provide a small sample XLIFF that behaves the way you have  described then we can try and investigate it.

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub



    Generated Image Alt-Text
    [edited by: Trados AI at 4:37 AM (GMT 0) on 29 Feb 2024]
  • Thanks for sending the files... I did get them after they been around the houses a bit.  Best solution is to add the content of the files as code using the "Insert" button here:

    Screenshot showing the 'Insert' button highlighted in the Trados Studio interface with an arrow pointing to the 'Code' option.

    Or zip them and attach the zip.

    But onto the topic.... the behaviour here is actually intended.  I used this small file as a sample (based on the one you sent me):

    <?xml version="1.0" encoding="UTF-8"?>
    <xliff version="2.0" xmlns="urn:oasis:names:tc:xliff:document:2.0" srcLang="en" trgLang="fr">
      <file id="ngi18n" original="ng.template" >
        <unit id="ngb.carousel.slide-number">
          <notes>
            <note category="location">node_modules/@ng-bootstrap/src/carousel/carousel.ts:114,118</note>
            <note category="description">Currently selected slide number read by screen reader</note>
          </notes>
          <segment state="initial">
            <source>Slide <ph id="0" equiv="INTERPOLATION" disp="OnHover$ = new"/> of <ph id="1" equiv="INTERPOLATION_1" disp="; private _pa"/></source>
            <target/>
          </segment>
        </unit>
        <unit id=%xxxxxxxxxxxxxxxxxx">
          <notes>
            <note category="location">src/app/core/services/actions/dirent/dirent-copy-move.service.ts:128,129</note>
            <note category="description">Files - Folders - Overwrite single file.png
            Files - Folders - Overwrite multi files.png</note>
          </notes>
          <segment state="initial">
            <source>Overwrite</source>
            <target/>
          </segment>
        </unit>
      </file>
    </xliff>

    If I open in Studio I'll see this intended behaviour:

    Trados Studio interface displaying a segment with source text 'Slide OnHover$ = new of' and an empty target field.

    The reason for this is that Studio is making this file more translatable for you by using the <ignorable> element to store the non-translatable code at the end of this segment between the visible segments, but all still within <unit id="ngb.carousel.slide-number">.  See the spec for more information:

    http://docs.oasis-open.org/xliff/xliff-core/v2.0/xliff-core-v2.0.html#ignorable

    So, if I display "All content" in Studio I can see where it's been stored out of the way:

    Trados Studio interface showing a segment with source text 'Slide OnHover$ = new of' and an ignorable code element at the end within the same unit.

    To avoid this the XLIFF needs to use the canResegment attribute as I have here:

    <?xml version="1.0" encoding="UTF-8"?>
    <xliff version="2.0" xmlns="urn:oasis:names:tc:xliff:document:2.0" srcLang="en" trgLang="fr">
      <file id="ngi18n" original="ng.template" canResegment="no" >
        <unit id="ngb.carousel.slide-number">
          <notes>
            <note category="location">node_modules/@ng-bootstrap/src/carousel/carousel.ts:114,118</note>
            <note category="description">Currently selected slide number read by screen reader</note>
          </notes>
          <segment state="initial">
            <source>Slide <ph id="0" equiv="INTERPOLATION" disp="OnHover$ = new"/> of <ph id="1" equiv="INTERPOLATION_1" disp="; private _pa"/></source>
            <target/>
          </segment>
        </unit>
        <unit id=%xxxxxxxxxxxxxxxxxx">
          <notes>
            <note category="location">src/app/core/services/actions/dirent/dirent-copy-move.service.ts:128,129</note>
            <note category="description">Files - Folders - Overwrite single file.png
            Files - Folders - Overwrite multi files.png</note>
          </notes>
          <segment state="initial">
            <source>Overwrite</source>
            <target/>
          </segment>
        </unit>
      </file>
    </xliff>

    So in the file element I added it like this:

    <file id="ngi18n" original="ng.template" canResegment="no" >

    Now when I open this file in Studio I see this:

    Trados Studio interface with a segment displaying source text 'Slide OnHover$ = new of' and target field without the ignorable code element after setting canResegment to 'no'.

    And the target will not have the ignorable element.

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub



    Generated Image Alt-Text
    [edited by: Trados AI at 4:37 AM (GMT 0) on 29 Feb 2024]