Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Leon 14 posts 105 karma points
    Jun 09, 2021 @ 09:00
    Leon
    0

    Translation Manager error: A duplicate reference to a SpanningCodeStart

    Hi,

    I'm currently testing the Translation Manager but having trouble reimporting the translated file back into the system.

    I'm getting a Validation Failed: A duplicate reference to a SpanningCodeStart with Id 1 cannot be used. as an error when uploading the translated document.

    It sounds like an obvious error so think it's something very straightforward but cannot find any information about what the SpanningCodeStart actually refers to or how we would fix it. There are a number of attributes with an ID=1 however these all seem to be within individual nodes, so don't think this should be the issue.

    Any help would be appreciated :)

    Thanks, Leon

  • Kevin Jump 2311 posts 14697 karma points MVP 7x c-trib
    Jun 09, 2021 @ 09:44
    Kevin Jump
    1

    Hi Leon,

    what has likely happened is that the translatior/service have returned the file and are re-using id values in the response file.

    e.g your 'target' node might look something like this:

    <target>
      <pc dataRefEnd="d2" dataRefStart="d1" id="1" subType="xlf:b" type="fmt">Some</pc> test <pc dataRefEnd="d2" dataRefStart="d1" id="1" subType="xlf:b" type="fmt">content</pc>
    </target>
    

    (in that example where both 'pc' values have an Id of 1) within the XLIFF specification these Id values have to be unique within a <target> or <source> element.

    when you see the error. you should also see a long location string something like:

    #/f=f1/g=g3/g=g5/g=u3-g/u=u3-1/t=1
    

    you can use this to find the issue, the "U" value will be the unit within the file,. so in this case if you where to search the file that you have been given for "u3-1" you would find the values in the XLIFF file and you could see what the target value looks like.

    Translation Manager does do quite a bit of tidy up work to attempt to catch things like this, but some of them just break the XLIFF specification so they are shown back to you and you have to discuss them with the translation people.

  • Leon 14 posts 105 karma points
    Jun 09, 2021 @ 11:35
    Leon
    0

    Hi Kevin,

    Thanks for the quick response, just to double check I'm reading it correctly. The ID's need to be unique only within the source or target node. i.e you can have a id=1 within source and id=1 within target, or do both ID's need to be unique?

    I've had a look at the unit causing the error and I can't see any duplicated ID's within the file. I've also noticed that the tags for the differently to the source values. I was hoping fixing these would resolve the issue but it still brings back the same error message, albeit with a different location string.

    The previous location string from the error message is: #/f=f1/g=g3/g=g4/g=g5/g=g6/g=u2-g/g=u2-1-g/g=u2-1-2-g/u=u2-1-2-7/t=4

    The new location string from the error message is: #/f=f1/g=g3/g=g4/g=g5/g=g6/g=u2-g/g=u2-1-g/g=u2-1-2-g/u=u2-1-2-7

    I've pasted the full unit below (before I altered it), just with some slight formatting for readability and the data removed. You'll see the pc tag isn't closed correctly compared to the source, which is something that will obviously need fixing however fixing this doesn't fix the original error.

    Is there anything else that you can see that could be causing this error, I'm not too familiar with the Xliff schema unfortunately but can't see anything obvious.

                     <unit id="u2-1-2-7" name="p">
                        <originalData>
                          <data id="d1">&lt;a href="url"&gt;</data>
                          <data id="d2">&lt;/a&gt;</data>
                          <data id="d3">&lt;em&gt;</data>
                          <data id="d4">&lt;/em&gt;</data>
                          <data id="d5">&lt;a href="url"&gt;</data>
                        </originalData>
                        <segment>
                          <source>
                            <sc dataRef="d1" id="1" type="link"/>
                            <pc dataRefEnd="d4" dataRefStart="d3" id="2" subType="xlf:i" type="fmt">Source 1</pc>
                            <ec dataRef="d2" startRef="1" type="link"/> <sc dataRef="d5" id="3" type="link"/><pc dataRefEnd="d4" dataRefStart="d3" id="4" subType="xlf:i" type="fmt">Source 2</pc><ec dataRef="d2" startRef="3" type="link"/><pc dataRefEnd="d4" dataRefStart="d3" id="5" subType="xlf:i" type="fmt"> </pc></source><target><sc dataRef="d1" id="1" type="link"/>
                            <pc dataRefEnd="d4" dataRefStart="d3" id="2" subType="xlf:i" type="fmt">Target 1</pc>
                            <ec dataRef="d2" startRef="1" type="link"/> <sc dataRef="d5" id="3" type="link"/>
                            <pc dataRefEnd="d4" dataRefStart="d3" id="4" subType="xlf:i" type="fmt">Target 2<ec dataRef="d2" startRef="1" type="link"/><pc dataRefEnd="d4" dataRefStart="d3" id="5" subType="xlf:i" type="fmt"/></pc></target>
                        </segment>
                      </unit>
    

    Thanks again, Leon

  • Kevin Jump 2311 posts 14697 karma points MVP 7x c-trib
    Jun 09, 2021 @ 11:55
    Kevin Jump
    100

    Hi Leon,

    it looks like the startRefg on the last

    you have

    <ec dataRef="d2" startRef="1" type="link"/>
    

    this should be

    <ec dataRef="d2" startRef="3" type="link"/> 
    

    its right in the source segment, guessing its a copy error into the target?

    as this pairs the opening and closing link together. you file has both closing

    so for completness i have this:

    <unit id="u2-1-2-7" name="p">
      <originalData>
        <data id="d1">&lt;a href="url"&gt;</data>
        <data id="d2">&lt;/a&gt;</data>
        <data id="d3">&lt;em&gt;</data>
        <data id="d4">&lt;/em&gt;</data>
        <data id="d5">&lt;a href="url"&gt;</data>
      </originalData>
      <segment>
        <source>
          <sc dataRef="d1" id="1" type="link"/>
          <pc dataRefEnd="d4" dataRefStart="d3" id="2" subType="xlf:i" type="fmt">Source 1</pc>
          <ec dataRef="d2" startRef="1" type="link"/>
          <sc dataRef="d5" id="3" type="link"/>
          <pc dataRefEnd="d4" dataRefStart="d3" id="4" subType="xlf:i" type="fmt">Source 2</pc>
          <ec dataRef="d2" startRef="3" type="link"/>
          <pc dataRefEnd="d4" dataRefStart="d3" id="5" subType="xlf:i" type="fmt"></pc>
        </source>
        <target>
          <sc dataRef="d1" id="1" type="link"/>
          <pc dataRefEnd="d4" dataRefStart="d3" id="2" subType="xlf:i" type="fmt">Target 1</pc>
          <ec dataRef="d2" startRef="1" type="link"/>
          <sc dataRef="d5" id="3" type="link"/>
          <pc dataRefEnd="d4" dataRefStart="d3" id="4" subType="xlf:i" type="fmt">Target 2</pc>
          <ec dataRef="d2" startRef="3" type="link"/>
          <pc dataRefEnd="d4" dataRefStart="d3" id="5" subType="xlf:i" type="fmt"/>
        </target>
      </segment>
    </unit>
    

    Updated: sorry - cut and pasted wrong!

  • Leon 14 posts 105 karma points
    Jun 09, 2021 @ 14:34
    Leon
    0

    Hi Kevin,

    Yes that's fixed it! Had a few more of the similar errors in the document but all seem to stem from minor copying errors during the translation process. As soon as I fixed these the file has imported.

    Thank you very much for your help :)

    Cheers Leon

Please Sign in or register to post replies

Write your reply to:

Draft