Exporting/Importing Bilingual Review documents. Import not working.

Hi

I am writing a program to export and import Bilingual Review documents for all files in a project using Trados Studio 2021 SR1 (build 16.1.5.4270).

The export part of the program is working fine. The folder used for the export is picked up from the project settings Language Pairs\All Language Pairs\Batch Processing\Export for Bilingual Review 

However, the import part of the program does nothing. Here's my code.

Fullscreen
1
2
3
4
5
6
7
8
Console.WriteLine("ImportBilingualReviewDocs");
Console.WriteLine("START Import");
AutomaticTask exportReview = project.RunAutomaticTask(
targetFiles.GetIds(),
AutomaticTaskTemplateIds.UpdateFromExternalReview,
(sender, taskStatusArgs) => taskStatusEventArgsList.Add(taskStatusArgs),
(sender, messageArgs) => messageEventArgsList.Add(messageArgs));
Console.WriteLine("END ImportBilingualReviewDocs");
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The output is:

ImportBilingualReviewDocs
START Import
END ImportBilingualReviewDocs

Checking the project proves it has not imported my changes.

I think it's failing to do anything because it does not know where the review DOCX files are located. I cannot see a way to specify this (I was expecting the program to use the project setting value above).

Can anyone enlighten me as to what I'm doing wrong? Can you share any working code examples?

Best Regards

Mark

emoji
  • Hi  , We'll review and circle back with more info; in the meantime, is there a reason why you are not using the latest SR2 CU12 release for 2021?

    ref crq: CRQ-33067

    emoji
  • An issue has been created on Jira with the internal tracking nr. CRQ-33067
    emoji
  • Hi  ,

    You will need to set the ImportFromReviewTaskSettings settings to provide the automation task the context to locate the updated documents.

    Note: You will need to update that settings group, before running the automation task.  If you need support in understanding how to update a settings group on the project, then make reference to here; the concept is the same.

    UI Reference:

    Trados Studio Batch Processing window showing Bilingual Review Document Update with a German project file selected and options to change status of updated segments or create a backup.

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 1:38 PM (GMT 0) on 5 Mar 2024]
  • Hi Patrick,

    My method is to iterate the target files in the project and map/import for each file.

    I am struggling with how to use the "mappings" list that I set on line 14. The ExternalReviewMappingItems property is read only so I cannot set it to my mappings. 

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    public void ImportBilingualReviewDocs()
    {
    ISettingsBundle settings = project.GetSettings(trgLang);
    ImportFromReviewTaskSettings impSettings = settings.GetSettingsGroup<ImportFromReviewTaskSettings>();
    List<ExternalReviewMappingItem> mappings = new List<ExternalReviewMappingItem>();
    ProjectFile[] files = project.GetTargetLanguageFiles();
    for (int i = 0; i < files.Length; i++)
    {
    string XliffFilePath = files[i].LocalFilePath;
    string BilingualReviewFileFullPath = XliffFilePath.Replace("sdlxliff", "review.docx").Replace(projectFolder, projectFolder + @"\External Review");
    Console.WriteLine("SDLXLiff {0}\nDOCX {1}", XliffFilePath, BilingualReviewFileFullPath);
    mappings.Add(new ExternalReviewMappingItem(XliffFilePath, project.GetProjectInfo().Id, BilingualReviewFileFullPath));
    impSettings.Backup.Value = false;
    impSettings.ConfirmationLevel.Value = ConfirmationLevel.Translated;
    project.UpdateSettings(trgLang, settings);
    Guid[] fileId = { files[i].Id };
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
     

    Any help gratefully received...

    Regards
    Mark

    emoji