Open multiple file with Trados Studio 2024

Hi All,

I found that in Trados Studio 2022 SR2 - 17.2.10.19084, if I use the ProjectFile.OpenDocument on multiple document (in a for iteration), then Studio freeze. If I open them as a single file, then they opens properly as a merged document (also i can open then manually one by one). Do you aware of this bug? Is there a fix on the road map? Or is there any workaround?

Thank you in advance for your response.

Best regards,

Balazs

Parents
  • Hi  , I'll review this and circle back to you with a more concrete response in the next days...

  • Hi , I've reviewed this, this morning, but didn't reproduce an issue while opening multiple project files sequentially in the editor.  This is not to say that there isn't an issue, more that there might be some other factor that is causing this on your machine. Large files, using a specific file type, plugins installed, OS configuration etc...

    The exception or problem might be registered in the logs?

    I've tested running the following code sample against latest releases of Trados Studio (2024 CU1 & 2022 SR2 CU11).  Does this code sample represent your scenario?

    var filesController = SdlTradosStudio.Application.GetController<FilesController>();
    var editorController = SdlTradosStudio.Application.GetController<EditorController>();
    
    var projectFilesOpenInEditor = editorController.GetDocuments();
    
    var projectFilesOpenedCount = 0;
    var editingMode = EditingMode.Translation;
    
    foreach (var projectFile in filesController.SelectedFiles)
    {
        var isDocumentOpenInEditor = 
            projectFilesOpenInEditor.Any(studioDocument => studioDocument.ActiveFile.Id == projectFile.Id);
        if (!isDocumentOpenInEditor)
        {
            editorController.Open(projectFile, editingMode);
            projectFilesOpenedCount++;
        }
    }
    
    MessageBox.Show($"Opened {projectFilesOpenedCount} documents in {editingMode} mode.\n\n" +
                    $"Total number of documents open in Editor {editorController.GetDocuments().Count()}");

    Demo

    Screenshot of Visual Studio IDE with a C# script open in the editor. The script is part of a project named 'CustomViewExample' and contains code for opening documents in Trados Studio.



    Generated Image Alt-Text
    [edited by: RWS Community AI at 4:28 AM (GMT 1) on 12 Oct 2024]
Reply
  • Hi , I've reviewed this, this morning, but didn't reproduce an issue while opening multiple project files sequentially in the editor.  This is not to say that there isn't an issue, more that there might be some other factor that is causing this on your machine. Large files, using a specific file type, plugins installed, OS configuration etc...

    The exception or problem might be registered in the logs?

    I've tested running the following code sample against latest releases of Trados Studio (2024 CU1 & 2022 SR2 CU11).  Does this code sample represent your scenario?

    var filesController = SdlTradosStudio.Application.GetController<FilesController>();
    var editorController = SdlTradosStudio.Application.GetController<EditorController>();
    
    var projectFilesOpenInEditor = editorController.GetDocuments();
    
    var projectFilesOpenedCount = 0;
    var editingMode = EditingMode.Translation;
    
    foreach (var projectFile in filesController.SelectedFiles)
    {
        var isDocumentOpenInEditor = 
            projectFilesOpenInEditor.Any(studioDocument => studioDocument.ActiveFile.Id == projectFile.Id);
        if (!isDocumentOpenInEditor)
        {
            editorController.Open(projectFile, editingMode);
            projectFilesOpenedCount++;
        }
    }
    
    MessageBox.Show($"Opened {projectFilesOpenedCount} documents in {editingMode} mode.\n\n" +
                    $"Total number of documents open in Editor {editorController.GetDocuments().Count()}");

    Demo

    Screenshot of Visual Studio IDE with a C# script open in the editor. The script is part of a project named 'CustomViewExample' and contains code for opening documents in Trados Studio.



    Generated Image Alt-Text
    [edited by: RWS Community AI at 4:28 AM (GMT 1) on 12 Oct 2024]
Children
No Data