Translation Memory - updating units by source text and translation text

Hello

I want to update unit in my translation memory, here is my example request

{  
  "translationUnit":{  
    "source":{  
      "language":"am-et",
      "text":"sourceTextValue"
    },
    "target":{  
      "language":"gsw-fr",
      "text":"translationTextValueNew"
    }
  },
  "settings":{  
    "existingTUsUpdateMode":"OverwriteCurrent",
    "fieldValues":[  
      {  
        "fieldName":"fieldName1",
        "values":[  
          "fieldNameValue1"
        ]
      },
      {  
        "fieldName":"fieldName2",
        "values":[  
          "fieldNameValue2"
        ]
      }, 
    ],
  }
}

I would like to unit that matches source, target, sourceText to be updated by new value from text-target( value from

    "target":{  
      "language":"gsw-fr",
      "text":"translationTextValueNew"
    })

 

Thx for help

  • Hi Adam,

    You can use the following endpoint to update a translation unit by text:

    Method: Put
    url: /api/tmservice/tms/{tmId}/tus/text
    Body:
    {
    "TranslationUnit": {
    "Source": {
    "Language": "am-et",
    "Text": "sourceTextValue"
    },
    "Target": {
    "Language": "gsw-fr",
    "Text": "translationTextValueNew"
    }
    },
    "Settings": {
    "ExistingTUsUpdateMode": "Overwrite"
    }
    }

    For "ExistingTUsUpdateMode" setting, you have the following possible values: "AddNew", "Overwrite", "LeaveUnchanged", "KeepMostRecent", "OverwriteCurrent"

    If you want to use "OverwriteCurrent" you have to add "PreviousTranslationHash" in the body. Some options (like "OverwriteCurrent") are used only when you have multiple translations for same "source Text" in order to update accordingly.

    Thanks