Clarification of ImportSettings

In the ExistingTUsUpdateMode it has the following:

Overwrites only the current TUs where the source segment matches and leaves other existing TUs unmodified.

I could not understand "current TUs". What does that mean and how does it differ from "existing TUs"?

Parents
  • OverwriteCurrent will behave as if you are updating your TU from the Studio Editor. To be more specific it will merge if there is an exact match, add if not or not do anything if there is a previous translation of that segment with an exact match. If there are previous translation those will not be deleted. Overwrite will remove existing translations to avoid duplicates in the TM hence it will not attempt merge with existing translations.

    Romulus Crisan | Translation Productivity Development Manager | SDL | (twitter) @cromica_82 | (blog) http://www.romuluscrisan.com/

Reply
  • OverwriteCurrent will behave as if you are updating your TU from the Studio Editor. To be more specific it will merge if there is an exact match, add if not or not do anything if there is a previous translation of that segment with an exact match. If there are previous translation those will not be deleted. Overwrite will remove existing translations to avoid duplicates in the TM hence it will not attempt merge with existing translations.

    Romulus Crisan | Translation Productivity Development Manager | SDL | (twitter) @cromica_82 | (blog) http://www.romuluscrisan.com/

Children
  • Thanks Romulus for the explanation.  I almost understand everything now, but I'm fuzzy about one point:

    The difference between

    >To be more specific it will merge if there is an exact match (1)

    and

    >not do anything if there is a previous translation of that segment with an exact match (2)

    (1) means "source segments are exact match" and "target segments differ"

    while

    (2) means "source segments are exact match" and "target segments are also exact match"


    Is my understanding correct?

  • Update 27th of May 2015: Corrected rules for (2)

    What I was trying to say for (2) is that if in the TM there is already a translation for that exact segment or an exact match then nothing will happen during the update. For point (1) if there is no translation for that exact segment but an exact match is found in the TM than the update value will be the merge result from that exact match and the update value.

    Romulus Crisan | Translation Productivity Development Manager | SDL | (twitter) @cromica_82 | (blog) http://www.romuluscrisan.com/

  • Hi Romulus,

    Thanks for the help. I was having a hard time understanding, so I decided to look at the source in Importer.ImportInternal:

        case ImportSettings.TUUpdateMode.OverwriteCurrent:

        if ((previousTranslationHash == weakHashCode || flag) && !flag2)

        {

            importResult.Action = Action.Discard;

        }

        else

        {

            if (previousTranslationHash == 0 && flag)

            {

                importResult.Action = Action.Merge;

            }

       //....

       }

    If your explanation was correct, shouldn't "(previousTranslationHash == weakHashCode || flag)" be "(previousTranslationHash == weakHashCode && flag)" instead? (I may be wrong about what "previousTranslationHash" means as I couldn't find that part).

    I don't fully understand what is going on, so I might be incorrect, but it seems like the source code is wrong according to your explanation. (and sorry for the poor code formatting...)

  • Ok, I think I keep finding more problems with the ImportInternal implementation....
    Please look at the following code:

    case ImportSettings.TUUpdateMode.Overwrite:
    case ImportSettings.TUUpdateMode.KeepMostRecent:

    Basically, "Overwrite" does the same thing as "KeepMostRecent". I don't think that is what its supposed to do.
  • Every translation has a unique has associated so the first condition is doing something like "(previousTranslationHash == currentTranslationHash || exactMatch )&&!previousTranslationWasDeleted". In your reasoning you didn't consider the second flag which if it's false the first condition becomes irrelevant, to be more exactly if the previousTranslationWasDeleted == true it will go on the else clause.

    I had a small mistake in my previous answer which I've correct and you can see it in red.

    Don't worry about code formatting ... we are working to add such support to the platform 

    Romulus Crisan | Translation Productivity Development Manager | SDL | (twitter) @cromica_82 | (blog) http://www.romuluscrisan.com/

  • That is not entirely correct. Yes both case statements are have the same code block but inside the code block there other verification done.

    Keep most recent will behave the same only if the scoring result is an exact match and there are no differences between the target segments.

    Romulus Crisan | Translation Productivity Development Manager | SDL | (twitter) @cromica_82 | (blog) http://www.romuluscrisan.com/

  • Thank you for your help!
    I understand now much better what is going on.
    The main reason for asking these questions is we are seeing a difference in the TMX import from before and after Cumulative Update 8 (released on 11 February 2015). Basically the System Fields are different. I will try to investigate more.
  • You can see all changes made as part of CU releases here:

     

    The changes we discussed were indeed introduced with CU8

    Romulus Crisan | Translation Productivity Development Manager | SDL | (twitter) @cromica_82 | (blog) http://www.romuluscrisan.com/