Under Community Review

Integration API: Refresh project settings in Studio Editor

Dear Trados Development Team,

It would be useful if there was a way to programmatically refresh/reload the project settings for an active translation session in the Studio Editor. 

An example for a use case of this function would be a plug-in button to replicate the following manual procedure:

  • Open Project Settings / Translation Memory and Automated Translation
  • Use... and select a specific TM to add to the project
  • Click on OK to close the Project Settings dialog
  • This triggers the update of the content in the Translation Memory Result view and matches are available immediately from the new TM.

However, doing the same automatically from a context menu command in the Editor controller, no refresh takes place and the new TM is not active even if I change segments. The only way to activate the new TM is to open the Project Settings dialog and manually click OK again to refresh the editor. 

I am looking for something like this:

EditorController ec = SdlTradosStudio.Application.GetController<EditorController>();
Document ad = ec?.ActiveDocument as Document;
FileBasedProject proj = ad?.Project;
if (proj != null)
{
    TranslationProviderConfiguration tpc = proj.GetTranslationProviderConfiguration();
    TranslationProviderReference tref = new TranslationProviderReference(new Uri("sdltm.https://path_to_TM"));
    TranslationProviderCascadeEntry ce = new TranslationProviderCascadeEntry(tref, false, true, true);
    tpc.Entries.Add(ce);
    proj.UpdateTranslationProviderConfiguration(tpc);
    proj.Save();

    ad.RefreshProjectSettings();     // desired API call along these lines to refresh the editor
}

Thank you for considering this idea in a future update of the Studio API.

Regards,

Attila