Plugin Update for Trados Studio 2024

I am trying to update my plugin for Trados 2024 and implemented all necessary changes mentioned in this article: https://developers.rws.com/studio-api-docs/articles/hints_tips/Update_Plugins/how_to_update_plugins_to_trados_studio_2024.html?tabs=standard

However, when I open a file to translate, I get null from the EditorController. Have you implemented any changes on how to get the EditorController?

I am attaching the code used to get the EditorController:

AppInitializer.cs

[ApplicationInitializer]
public class AppInitializer : IApplicationInitializer
{
  public static EditorController EditorController { get; private set; }

  public void Execute()
  {
    EditorController = SdlTradosStudio.Application.GetController<EditorController>();
  }
}

I would be grateful if you could assist me with this.

Parents
  • Hi ,

    Features around loading the controllers have changed with the release of 2024. You'll need to wait until Studio has fully loaded before the controllers are available.  Make these changes to your AppInitializer class

    		public static EditorController EditorController { get; private set; }
    
    
    		public void Execute()
            {
                SdlTradosStudio.Application.GetService<IStudioEventAggregator>()
                    .GetEvent<StudioWindowCreatedNotificationEvent>().Subscribe(OnStudioWindowCreated);
            }
    
            private void OnStudioWindowCreated(StudioWindowCreatedNotificationEvent obj)
            {
                EditorController = SdlTradosStudio.Application.GetController<EditorController>();
            }

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

Reply
  • Hi ,

    Features around loading the controllers have changed with the release of 2024. You'll need to wait until Studio has fully loaded before the controllers are available.  Make these changes to your AppInitializer class

    		public static EditorController EditorController { get; private set; }
    
    
    		public void Execute()
            {
                SdlTradosStudio.Application.GetService<IStudioEventAggregator>()
                    .GetEvent<StudioWindowCreatedNotificationEvent>().Subscribe(OnStudioWindowCreated);
            }
    
            private void OnStudioWindowCreated(StudioWindowCreatedNotificationEvent obj)
            {
                EditorController = SdlTradosStudio.Application.GetController<EditorController>();
            }

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

Children