Hi everybody,
I am developing a translation provider plug-in that utilizes machine translation for Trados Studio 2024 and I have used the translation provider plugin template to set up the project. My machine translation will be able to utilize fuzzy translations based on Translation Memories to improve the translation result.
For this I need to access the Translation Memories in the project. To make this work I added the necessary Assemblies to be able to use the automation framework. These are not configured automatically in that template.
Now I can query the existing Translation Memories in the project with:
ProjectsController projectsController = SdlTradosStudio.Application.GetController<ProjectsController>(); FileBasedProject currentProject = projectsController.CurrentProject; TranslationProviderConfiguration config = currentProject.GetTranslationProviderConfiguration();
Then iterate over the config, get the provider reference, its Uri, check if it is a FileBasedTranslationMemory and then create a new FileBasedTranslationMemory to be able to search on it.
foreach (TranslationProviderCascadeEntry entry in config.Entries) { TranslationProviderReference mtp = entry.MainTranslationProvider; List<TranslationProviderReference> ptms = entry.ProjectTranslationMemories; if (FileBasedTranslationMemory.IsFileBasedTranslationMemory(mtp.Uri)) { string tmPath = FileBasedTranslationMemory.GetFileBasedTranslationMemoryFilePath(mtp.Uri); FileBasedTranslationMemory fbTm = new FileBasedTranslationMemory(tmPath); //... } //same for ptms I think }
Now my questions:
Would it also be possible somehow to get the TranslationMemory objects, that Trados uses internally directly if they are active in the project anyway?
With the method described above: does the FileBasedTranslationMemory object get updated automatically if the corresponding Translation Memory gets updated, e.g. if a new translation gets added, or do I need to check it manually somehow and then create a new FileBasedTranslationMemory object?
Do you have any additional infos that I might need here? Am I on the right track with the Automation API?
Thank you in advance!
- Lukas