With the recent Trados Studio 2017 CU9 update there are 4 new cool additions to the Integration API. All these changes came as feedback in the developer community so I'm really proud that I can now talk about them.
When setting active segment the control focus was not changing
When using the SetActiveSegmentPair there was a problem where the focus was not moved to the correct editor control. In order to fix this issue the method exposes an additional boolean parameter, setFocusOnSegment, which gives the developer the ability to control the focus behaviour. By default the value is false in order to maintain
backwards compatibility similar behaviour with existing implementations that already rely on this method.
document.SetActiveSegmentPair(projectFile:projectFile, segmentNumnber:segmentNumber, setFocusOnSegment:true);
Adding comments to segments with track change on was not working
This is now fixed and is available without any changes to the method signature. In other words there's nothing to be done in your plugin. The fix affects all of the following methods:
Expose detailed information about current editor text selection
This is a new addition to the Integration API and is meant to provide more information around the current text selection set in the editor. You will now be able to get the following information related to a text selection:
- row number
- segment id
- cursor position
- if the selection is empty or reversed
The following example creates an action on the Trados Studio ribbon which extracts the content selection information and displays it in the window. The purpose of this example is to show how to work with the new exposed information:
Improved project notification
As a developer you're now able to get notified in your plugin when a project is created, opened or published. As we expect to expose more Trados Studio events in the future we decided that we need a simple mechanism for developers to register to the events so it was a good opportunity to introduce a new pattern called event aggregator. It's not mandatory to to read about this pattern in detail as the registering mechanism is straight forward but if you're looking to broaden your knowledge it's something worth reading about.
The following example creates a new view part on the projetcs view that will display and append a message every time a project is opened, created or published.
Kudos for this awesome additions goes to the Studio engineering team.