Uploaded image for project: 'translate5'
  1. translate5
  2. TRANSLATE-3420

SDLxliff corrupt after export, if imported untranslated into translate5 and containing internal tags of type locked

    XMLWordPrintable

Details

    Description

      An sdlxliff document can contain trans-units, that are locked for editing.

      Those trans-units may be referenced in other segments as internal tags, that point to the locked trans-unit and the tag actually represents some content, that should not be translated inside this segment.

      Actually it might also happen, that the segment such a tag references to, is not locked, but editable. Yet this should not matter for this issue.

      The problem is, that if such a tag that stands for another trans-unit, is copied from source to target, translate5 keeps the value of the xid of the tag, because it does not modify tags.

      Yet Trados Studio recalculates all such referencing xid's probably when saving the file. In this process the xid value of the tag in the source gets a new value and the xid value of the same tag in the target gets a new value also - but NOT the same as its correspondent tag in the source. What is weird, but it is like it is.

      To make the behavior completely weird, the trans-unit to what the xid value is referencing is also copied. And the original trans-unit gets a new trans-unit ID referencing to the xid of the tag in the source and the copied trans-unit gets the trans-unit ID referencing to the xid of the tag in the target.

      As an example the to be translated trans-unit and the referenced locked trans-units in the untranslated sdlxliff may look like this:

      <trans-unit id="lockTU_7e7c6c3a-3b20-4403-b9fe-60bd49bbd54a" translate="no" sdl:locktype="Manual"><source>actual</source></trans-unit>
      <trans-unit id="lockTU_878970eb-a414-45d5-b929-3d0b2db786dc" translate="no" sdl:locktype="Manual"><source>utilization</source></trans-unit>
      <trans-unit id="lockTU_8994fc76-3cf3-432f-a00e-448713d57591" translate="no" sdl:locktype="Manual"><source>actual</source></trans-unit>
      <trans-unit id="lockTU_c9972fca-c0a4-40d0-baf6-332eb7867aa6" translate="no" sdl:locktype="Manual"><source>utilization</source></trans-unit>

      <trans-unit id="d76dd574-3ea0-4120-93f2-c9da6204c611">
          <source>Maximaler Achsabstand a<x id="173"/>max<x id="174"/>: <g id="175"><x id="locked1" xid="lockTU_8994fc76-3cf3-432f-a00e-448713d57591"/></g> (<g id="176"><x id="locked2" xid="lockTU_c9972fca-c0a4-40d0-baf6-332eb7867aa6"/></g> Ausnutzung)</source>
          
          <seg-source><mrk mtype="seg" mid="21">Maximaler Achsabstand a<x id="173"/>max<x id="174"/>:</mrk> <mrk mtype="seg" mid="22"><g id="175"><x id="locked3" xid="lockTU_7e7c6c3a-3b20-4403-b9fe-60bd49bbd54a"/></g> (<g id="176"><x id="locked4" xid="lockTU_878970eb-a414-45d5-b929-3d0b2db786dc"/></g> Ausnutzung)</mrk></seg-source>
          
          <target><mrk mtype="seg" mid="21"/> <mrk mtype="seg" mid="22"/></target>
          
          <sdl:seg-defs><sdl:seg id="21"><sdl:value key="SegmentIdentityHash">vWC7BU2xmwN2Kk7SHb0Zg3L3t8A=</sdl:value></sdl:seg><sdl:seg id="22"><sdl:rep id="DZ3sZFw23dfhNouda3k+Z4Dmyuo="/><sdl:value key="SegmentIdentityHash">DZ3sZFw23dfhNouda3k+Z4Dmyuo=</sdl:value></sdl:seg></sdl:seg-defs>
          
      </trans-unit>

      Already here the xid of the tag in the seg-source is referencing to a different trans-unit, as the same tag in the source.

      E. g. the tag <x id="locked1" in the source is referencing with its xid to the trans-unit with the ID lockTU_8994fc76-3cf3-432f-a00e-448713d57591.

      If now the tag is copied from source to target in Trados Studio and the file is saved, a third trans-unit is added, that copies this one:

      <trans-unit id="lockTU_8994fc76-3cf3-432f-a00e-448713d57591" translate="no" sdl:locktype="Manual"><source>actual</source></trans-unit>

      AND: For all referenced trans-units the IDs are changed.

      So the resulting trans-unit in the translated sdlxliff looks like this:

      <trans-unit id="lockTU_2857ea1d-23b6-4cf8-97c3-43981496827e" translate="no" sdl:locktype="Manual"><source>actual</source></trans-unit>
      <trans-unit id="lockTU_55773e0a-4090-451b-b261-6f84e9453f71" translate="no" sdl:locktype="Manual"><source>utilization</source></trans-unit>
      <trans-unit id="lockTU_ee1f2576-1fe6-4969-9ce5-f12cfc3974ec" translate="no" sdl:locktype="Manual"><source>actual</source></trans-unit>
      <trans-unit id="lockTU_b5d5505a-a83f-40f7-ac1c-5f4ef6bede83" translate="no" sdl:locktype="Manual"><source>utilization</source></trans-unit>
      <trans-unit id="lockTU_94d70c92-3794-4960-90c9-dcd632e8dd9d" translate="no" sdl:locktype="Manual"><source>actual</source></trans-unit>
      <trans-unit id="lockTU_d7f42a76-0aeb-4010-98f5-2f558d3e5a18" translate="no" sdl:locktype="Manual"><source>utilization</source></trans-unit>
      <trans-unit id="d76dd574-3ea0-4120-93f2-c9da6204c611">
          
          <source>Maximaler Achsabstand a<x id="173"/>max<x id="174"/>: <g id="175"><x id="locked1" xid="lockTU_94d70c92-3794-4960-90c9-dcd632e8dd9d"/></g> (<g id="176"><x id="locked2" xid="lockTU_d7f42a76-0aeb-4010-98f5-2f558d3e5a18"/></g> Ausnutzung)</source>
          
          <seg-source><mrk mtype="seg" mid="21">Maximaler Achsabstand a<x id="173"/>max<x id="174"/>:</mrk> <mrk mtype="seg" mid="22"><g id="175"><x id="locked3" xid="lockTU_ee1f2576-1fe6-4969-9ce5-f12cfc3974ec"/></g> (<g id="176"><x id="locked4" xid="lockTU_b5d5505a-a83f-40f7-ac1c-5f4ef6bede83"/></g> Ausnutzung)</mrk></seg-source>
          
          <target><mrk mtype="seg" mid="21">Maximaler Achsabstand a<x id="173"/>max<x id="174"/>:</mrk> <mrk mtype="seg" mid="22"><g id="175"><x id="locked5" xid="lockTU_2857ea1d-23b6-4cf8-97c3-43981496827e"/></g> (<g id="176"><x id="locked6" xid="lockTU_55773e0a-4090-451b-b261-6f84e9453f71"/></g> Ausnutzung)</mrk></target>
          
          <sdl:seg-defs><sdl:seg id="21" conf="Translated" origin="source"><sdl:value key="SegmentIdentityHash">vWC7BU2xmwN2Kk7SHb0Zg3L3t8A=</sdl:value><sdl:value key="created_by">LIVEWIN0\administrator</sdl:value><sdl:value key="created_on">07/08/2023 14:49:30</sdl:value><sdl:value key="last_modified_by">LIVEWIN0\administrator</sdl:value><sdl:value key="modified_on">07/08/2023 14:49:30</sdl:value></sdl:seg><sdl:seg id="22" conf="Translated" origin="source"><sdl:rep id="DZ3sZFw23dfhNouda3k+Z4Dmyuo="/><sdl:value key="SegmentIdentityHash">DZ3sZFw23dfhNouda3k+Z4Dmyuo=</sdl:value><sdl:value key="created_by">LIVEWIN0\administrator</sdl:value><sdl:value key="created_on">07/08/2023 14:49:31</sdl:value><sdl:value key="last_modified_by">LIVEWIN0\administrator</sdl:value><sdl:value key="modified_on">07/08/2023 14:49:31</sdl:value></sdl:seg></sdl:seg-defs>
          
      </trans-unit>

      For sake of how our tag check in translate5 ect. works, inside translate5 we should simply continue to take over the tag from source to target unchanged.

      Yet we need now to mimic this behavior, when exporting the sdlxliff:

      • Duplicate the trans-unit, that is referenced in the xid of the internal tag of the target
      • Generate a new id for the duplicated trans-unit and change the value of the xid of the x-tag in the target.

      Please do not rely on some information that a segment is locked in this process, because I guess, this referencing mechanism may also be used for not locked trans-units.

      Please find attached three example sdlxliff files with only one trans-unit, that show the pre-import status (untranslated), the post-translate5 translation status (corrupt) and the post translate5 translation status (repaired - this is what translate5 should produce automatically in the future).

       

       

      Attachments

        Issue Links

          Activity

            People

              aleksandar Aleksandar Mitrev
              marcmittag Marc Mittag [Administrator]
              Thomas Lauria
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: