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

  • 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]
  • Regarding the original question, the use-case is the following: We do some long running task, from which the user gets some response after an hour or so per document. Since it is a long running tasks, it is usually started for off-work hours, therefore the users tipically selects multiple files and starts the task before they leave the office. Next morning, when the result is ready, the user opens this task and with this task we open the selected files.

    Yeah your repduction does cover what we does. One difference that I spotted from your video is that, there are some popup when we open these files, for example the GS login dialog and the warning that studio cannot connect to termbase/TM. So these files are not unsually large, or there is no other relevant difference at first guess.

  • PS: Yeah i can confirm. I made a small app with your code. Tried to open 5 files, it opened the files, there was multiple GS login dialog (all of them was cancalled),then a dialog with a message with "Could not connect to 'xyxyxy' termbases, so you cannot use them for term recognition." also multiple times. All the files are opened, but afterwards studio is frozen (not able to select segment, click on any button, so everything si frozen). No other plugin installed. Studio 2022 SR2 is used.

  • Hi  , thx for following up with this.

    So this issue is reproduceable when you have a GS termbase connected to the project, but you don't have credentials to login.

    Can you confirm the steps to reproduce underneath.

    Steps to reproduce:

    1. You open a project that has a GS termbase connected.
    2. You don't have the credentials to login to the GS server on your machine.
    3. When running the sample code, provided in the previous post.
      1. Each document is opened in the Editor
      2. For each document, a window is displayed prompting you to provide your credentials.
      3. You cancel or dismiss all of these windows asking you to provide your credentials by clicking cancel or close.
    4. Then Studio become unresponsive.

    Does it also crash/freeze when you have provided the credentials to connect to the GS termbase provider before you start the process to open the documents?

    A workaround might be to deactivate (un-enable) the GS termbase provider if you don't have the credentials to login.  In that way you won't be prompted to login each time a document is opened in the editor, right?

  • Yes, the reproduction steps are right (regarding 3b for not all document the prompt displayed but multiple one, so likefor 5 document there was 3 propmpt maybe, but definitely not 5, not sure if it is important or not)

    Haven't tried that scenario.

    Yep, the workaround should work.