Plugin buttons missing when Comments are not displayed

[RibbonGroup("DGTQATButtonsGroup", ContextByType = typeof(EditorController))]

[RibbonGroupLayout(LocationByType = typeof(TranslationStudioDefaultRibbonTabs.EditorReviewRibbonTabLocation))]

class DGTQATButtonsGroup : AbstractRibbonGroup

{

}


[Action("CountComents", Icon = "trad19_view-evaluation_icon")]

[ActionLayout(typeof(DGTQATButtonsGroup), 1, DisplayType.Large)]

class StatsButton : AbstractAction

{

}

When we open a document in review mode, it initially appears correctly:

Trados Studio Review tab showing the Evaluation summary button circled in red.

Our problem is the following:

  • On Studio 2021, the ribbon group disappears unless the “Translation results” pane is selected

  • On Studio 2024, the ribbon group disappears unless the “Comments” pane is selected:

Trados Studio editor view with the DGT button circled in red and the Comments pane highlighted.

Trados Studio editor view with the Translation Results pane circled in red and the Quality Assurance section empty.


I don’t see any logical relation between selected results pane and ribbons, but multiple users have experimented this and came to same conclusion.

I also did not find anything in the API doing such a link:

[AttributeUsage(AttributeTargets.Class)]

[ExtensionPointInfo("Ribbon Groups", ExtensionPointBehavior.Static)]

public class RibbonGroupAttribute : AbstractCommandBarItemAttribute

{

public RibbonGroupAttribute(string id);

public RibbonGroupAttribute(string id, string name);

public RibbonGroupAttribute(string id, Type contextByType);

public RibbonGroupAttribute(string id, string name, Type contextByType);

}

[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]

public sealed class RibbonGroupLayoutAttribute : AbstractLayoutAttribute

{

[EditorBrowsable(EditorBrowsableState.Never)]

public RibbonGroupLayoutAttribute();

public RibbonGroupLayoutAttribute(Type locationType);

}


The only parameter indicating ribbon’s location is “contextByType”, all the samples I saw were using TranslationStudioDefaultRibbonTabs.EditorReviewRibbonTabLocation

I do not see any parameter related to tabs in the editor.

Also the class AbstractRibbonGroup is empty, no parameter to be set without C#’s annotations.

Is there any way to have the ribbon group appearing each time the "Review" part is selected, independently from what is selected in the part which contains translation results or comments?




Generated Image Alt-Text
[edited by: RWS Community AI at 2:28 PM (GMT 1) on 6 Oct 2025]
Parents
  • Hi  , I'll add a task to provide more clarity in our documentation around this.  In the meantime here is a complete example of how to achive this in your code project.

    using Sdl.Desktop.IntegrationApi;
    using Sdl.Desktop.IntegrationApi.Extensions;
    using Sdl.TranslationStudioAutomation.IntegrationApi;
    using Sdl.TranslationStudioAutomation.IntegrationApi.Presentation.DefaultLocations;
    using System.Windows;
    
    namespace CustomViewExample.Ribbon.Actions
    {
    
        [RibbonGroup("CustomViewExample_MyEditorActionsGroup", "My Editor Group")]
        [RibbonGroupLayout(LocationByType = typeof(TranslationStudioDefaultRibbonTabs.EditorReviewRibbonTabLocation))]
        public class MyEditorActionsGroup : AbstractRibbonGroup
        {
        }
    
        [Action(Id = "CustomViewExample_MyAction1_Id", Name = "Action 1", Description = "Action 1 Description",
    		Icon = "wordLight_yellow", ContextByType = typeof(EditorController))]
    	[ActionLayout(typeof(MyEditorActionsGroup), 3, DisplayType.Large, "Action 1", true)]
    	internal class MyAction1 : AbstractAction
    	{
    		protected override void Execute()
    		{
    			var editorController = SdlTradosStudio.Application.GetController<EditorController>();
    			if (editorController.ActiveDocument == null)
    			{
    				return;
    			}
    			var activeFile = editorController.ActiveDocument.ActiveFile;
    
    			// return false and nothing happens (with any file with any segment id)
    			var result = editorController.ActiveDocument.SetActiveSegmentPair(activeFile, "1", true);
    
    
    			MessageBox.Show("Selected Segment 1 (Action 1):" + result);
    		}
    	}
    
        [Action(Id = "CustomViewExample_MyAction2_Id", Name = "Action 2", Description = "Action 2 Description",
            ContextByType = typeof(EditorController))]
        [ActionLayout(typeof(MyEditorActionsGroup), 0, DisplayType.Normal, "Action 2", true)]
        internal class MyAction2 : AbstractAction
        {
            protected override void Execute()
            {
                var editorController = SdlTradosStudio.Application.GetController<EditorController>();
                if (editorController.ActiveDocument == null)
                {
                    return;
                }
                var activeFile = editorController.ActiveDocument.ActiveFile;
    
                // return false and nothing happens (with any file with any segment id)
                var result = editorController.ActiveDocument.SetActiveSegmentPair(activeFile, "2", true);
    
    
                MessageBox.Show("Selected Segment 2 (Action 2):" + result);
            }
        }
    
        [Action(Id = "CustomViewExample_MyAction3_Id", Name = "Action 3", Description = "Action 3 Description",
            ContextByType = typeof(EditorController))]
        [ActionLayout(typeof(MyEditorActionsGroup), 0, DisplayType.Normal, "Action 3", true)]
        internal class MyAction3 : AbstractAction
        {
            protected override void Execute()
            {
                var editorController = SdlTradosStudio.Application.GetController<EditorController>();
                if (editorController.ActiveDocument == null)
                {
                    return;
                }
                var activeFile = editorController.ActiveDocument.ActiveFile;
    
                // return false and nothing happens (with any file with any segment id)
                var result = editorController.ActiveDocument.SetActiveSegmentPair(activeFile, "3", true);
    
    
                MessageBox.Show("Selected Segment 3 (Action 3):" + result);
            }
        }
    }

    let me know how it goes

    Patrick Andrew Hartnett | Developer Experience | Team Lead | RWS Group

Reply
  • Hi  , I'll add a task to provide more clarity in our documentation around this.  In the meantime here is a complete example of how to achive this in your code project.

    using Sdl.Desktop.IntegrationApi;
    using Sdl.Desktop.IntegrationApi.Extensions;
    using Sdl.TranslationStudioAutomation.IntegrationApi;
    using Sdl.TranslationStudioAutomation.IntegrationApi.Presentation.DefaultLocations;
    using System.Windows;
    
    namespace CustomViewExample.Ribbon.Actions
    {
    
        [RibbonGroup("CustomViewExample_MyEditorActionsGroup", "My Editor Group")]
        [RibbonGroupLayout(LocationByType = typeof(TranslationStudioDefaultRibbonTabs.EditorReviewRibbonTabLocation))]
        public class MyEditorActionsGroup : AbstractRibbonGroup
        {
        }
    
        [Action(Id = "CustomViewExample_MyAction1_Id", Name = "Action 1", Description = "Action 1 Description",
    		Icon = "wordLight_yellow", ContextByType = typeof(EditorController))]
    	[ActionLayout(typeof(MyEditorActionsGroup), 3, DisplayType.Large, "Action 1", true)]
    	internal class MyAction1 : AbstractAction
    	{
    		protected override void Execute()
    		{
    			var editorController = SdlTradosStudio.Application.GetController<EditorController>();
    			if (editorController.ActiveDocument == null)
    			{
    				return;
    			}
    			var activeFile = editorController.ActiveDocument.ActiveFile;
    
    			// return false and nothing happens (with any file with any segment id)
    			var result = editorController.ActiveDocument.SetActiveSegmentPair(activeFile, "1", true);
    
    
    			MessageBox.Show("Selected Segment 1 (Action 1):" + result);
    		}
    	}
    
        [Action(Id = "CustomViewExample_MyAction2_Id", Name = "Action 2", Description = "Action 2 Description",
            ContextByType = typeof(EditorController))]
        [ActionLayout(typeof(MyEditorActionsGroup), 0, DisplayType.Normal, "Action 2", true)]
        internal class MyAction2 : AbstractAction
        {
            protected override void Execute()
            {
                var editorController = SdlTradosStudio.Application.GetController<EditorController>();
                if (editorController.ActiveDocument == null)
                {
                    return;
                }
                var activeFile = editorController.ActiveDocument.ActiveFile;
    
                // return false and nothing happens (with any file with any segment id)
                var result = editorController.ActiveDocument.SetActiveSegmentPair(activeFile, "2", true);
    
    
                MessageBox.Show("Selected Segment 2 (Action 2):" + result);
            }
        }
    
        [Action(Id = "CustomViewExample_MyAction3_Id", Name = "Action 3", Description = "Action 3 Description",
            ContextByType = typeof(EditorController))]
        [ActionLayout(typeof(MyEditorActionsGroup), 0, DisplayType.Normal, "Action 3", true)]
        internal class MyAction3 : AbstractAction
        {
            protected override void Execute()
            {
                var editorController = SdlTradosStudio.Application.GetController<EditorController>();
                if (editorController.ActiveDocument == null)
                {
                    return;
                }
                var activeFile = editorController.ActiveDocument.ActiveFile;
    
                // return false and nothing happens (with any file with any segment id)
                var result = editorController.ActiveDocument.SetActiveSegmentPair(activeFile, "3", true);
    
    
                MessageBox.Show("Selected Segment 3 (Action 3):" + result);
            }
        }
    }

    let me know how it goes

    Patrick Andrew Hartnett | Developer Experience | Team Lead | RWS Group

Children
No Data