SDK API Pre-translate task randomly skips file

Good morning,

We have noticed an issue with the SDK API Pre-translate automatic task.

Our SDL Trados Project contains three files (apfel.xml, banane.xml, kirsche.xml) and two file-based translation memories.

We then want to pre-translate all three via the SDK API automatic task, which is called via Windows CMD prompt.

We can run the pre-translate task in two ways, one where we specify the target language; and another where we specify the file GUIDs to apply the task to.

Method 01:

ProjectFile[] targetFiles = ThisSdlProject.GetTargetLanguageFiles(LanguageRegistryApi.Instance.GetLanguage(TargetLanguageCode));
AutomaticTask preTranslate = ThisSdlProject.RunAutomaticTask(targetFiles.GetIds(), AutomaticTaskTemplateIds.PreTranslateFiles);
AutomaticTask populateProjectMemory = ThisSdlProject.RunAutomaticTask(targetFiles.GetIds(), AutomaticTaskTemplateIds.PopulateProjectTranslationMemories);

Method 02:

string[] TargetFileGuidArray = ProvidedTargetFileGuids.Split(',');
Guid[] TargetFileGuids = new Guid[TargetFileGuidArray.Length];
for (int i = 0; i < TargetFileGuidArray.Length; i++){
    TargetFileGuids[i] = new Guid(TargetFileGuidArray[i]);
}
var targetFiles = studioProject.GetFiles(TargetFileGuids);
studioProject.RunAutomaticTasks(targetFiles.GetIds(), new[] { AutomaticTaskTemplateIds.PreTranslateFiles });
studioProject.RunAutomaticTasks(targetFiles.GetIds(), new[] { AutomaticTaskTemplateIds.PopulateProjectTranslationMemories });

Symptoms: Seemingly randomly, any one of the files is missing from the task, therefore is not translated and does not appear in the task report. 

Because the error can occur randomly, I cannot get the app to fail on demand.

However, if I loop through the command 10 times, on average it will fail twice. The file that is missed can change, so it's not as if it is the first, second or last in the file list.

Pre-translate 01 & 02 includes all three files:

XML code snippet showing a 'translate' task with three files listed: apfel.xml.sdlxliff, banane.xml.sdlxliff, and kirsche.xml.sdlxliff, each with a unique GUID.

Pre-translate 03 (<3 seconds later) only includes two of the three files:

XML code snippet showing a 'translate' task with two files listed: apfel.xml.sdlxliff and banane.xml.sdlxliff, each with a unique GUID. The kirsche.xml.sdlxliff file is missing.

Because the command is in a loop, no variables or settings are changed.

Issue occurs in both Trados Studio 2022 17.0.0.11594 and SR1 17.1.6.16252.

I'm interested if anyone else has experienced anything similar, a solution/workaround and/or has a more robust method of running the automatic tasks.

Any troubleshooting suggestions are most welcome.

Thanks in advance,

Samuel



Generated Image Alt-Text
[edited by: RWS Community AI at 8:02 AM (GMT 0) on 15 Nov 2024]
Parents
  • Hi  ,  I will review this issue tomorrow and try to reproduce before we escalate the problem to the development team.  In the meantime can you help me by providing additional information:

    1. The problem only occurns when you run both PreTranslateFiles & PopulateProjectTranslationMemories batch tasks or also when you only run PreTranslate?
    2. Are you running the batch task for pretranslate with a single TM, multiple TM (local, server, other type of provider...)
    3. The issue occurs when you are running multiple batch tasks in parallel or in sequence one after the other?
      1. Remember Trados Studio is a Desktop application and not designed to function like a server.
    4. Can you provide me with the Trados log files when you are able to reproduce? might be something tracked there that can help...
    5. The issue occurs on the default Studio project (type)?
  • Hi  

    Thanks for the reply, here is some extra info:

    1. The problem only occurs when you run both PreTranslate & PopulateProjectTranslationMemories batch tasks or also when you only run PreTranslate?
      1. Error occurs in both scenarios; PreTranslate and PopulateProjectTranslationMemories, as well as just PreTranslate 
    2. Are you running the batch task for pretranslate with a single TM, multiple TM (local, server, other type of provider...)
      1. Error occurs with single file based TM and also two file based TMs
    3. The issue occurs when you are running multiple batch tasks in parallel or in sequence one after the other?
      1. In sequence, one after another. No other SDL processes running concurrently.
    4. Can you provide me with the Trados log files when you are able to reproduce? might be something tracked there that can help...
      1. Where can I find the Trados log files?
    5. The issue occurs on the default Studio project (type)?
      1. Correct, standard project/(HTML) file type

    I have this morning, ran the pre-translate loop command again, and it failed in 1/10 attempts, this time it excluded 2/3 files.

    I then checked the SDL Project File (AutomaticTask) entries and can see 9th attempt has the status='Failed'

    9th Automatic Task:

     

    The error displays for 2/3 files:

    Details of error:

    This looks like the previous issue we experienced.

    This is the current app.config:

    Happy to provide the SDK app, along with all test environment assets; if required.

    Thanks

    Samuel

Reply
  • Hi  

    Thanks for the reply, here is some extra info:

    1. The problem only occurs when you run both PreTranslate & PopulateProjectTranslationMemories batch tasks or also when you only run PreTranslate?
      1. Error occurs in both scenarios; PreTranslate and PopulateProjectTranslationMemories, as well as just PreTranslate 
    2. Are you running the batch task for pretranslate with a single TM, multiple TM (local, server, other type of provider...)
      1. Error occurs with single file based TM and also two file based TMs
    3. The issue occurs when you are running multiple batch tasks in parallel or in sequence one after the other?
      1. In sequence, one after another. No other SDL processes running concurrently.
    4. Can you provide me with the Trados log files when you are able to reproduce? might be something tracked there that can help...
      1. Where can I find the Trados log files?
    5. The issue occurs on the default Studio project (type)?
      1. Correct, standard project/(HTML) file type

    I have this morning, ran the pre-translate loop command again, and it failed in 1/10 attempts, this time it excluded 2/3 files.

    I then checked the SDL Project File (AutomaticTask) entries and can see 9th attempt has the status='Failed'

    9th Automatic Task:

     

    The error displays for 2/3 files:

    Details of error:

    This looks like the previous issue we experienced.

    This is the current app.config:

    Happy to provide the SDK app, along with all test environment assets; if required.

    Thanks

    Samuel

Children