Deepl - caaling from 3rd party apps

Hi,

I would like to utilize Deepl Plugin to call it from my app/plugin (automatization app for Trados). Is there any step-by-step how to configure it and call it? I checked the source code but I'm not sure how properly to call it if I have my project with files to be translated and I want to trigger automatization task via Trados Api.

emoji
  • Hi ,  I have uploaded a complete example here that you can use to understand how to call the DeepL provider from project automation in a StandAlone application.

    Example project:
    https://github.com/RWS/Sdl-Community/tree/master/Code%20samples/ProjectAutomation/ProjectAutomation

    Steps:

    1. Download an install the signed version of DeepL provider first.  You can download it from here: https://appstore.rws.com/Plugin/24

    2. Install Trados Studio 2024 (latest CU)

    3. Open the sample project (above) in VS.
    Important: open the VS as a admin.  This is needed as you'll be compiling & running the exe in the installation folder of Trados Studio

    4. In VS, ensure you have unchecked the option PInvokeStackImbalance
    - Open the Exception Settings: Ctrl+Alt+E
    - Uncheck: Managed Debugging Assistants->PInvokeStackImbalance

    5. From the program.cs, update the information  in the TODO's

    static void Main(string[] args)
    {
        // TODO: Set location where to find the source files
        var sourceFilesDirectory = @"c:\temp\source files folder";
    
        // TODO: Set location for the project output folder... projects will be created here in sub-folders
        var projectsDirectory = @"c:\temp\projects";
        if (!Directory.Exists(projectsDirectory))
    	{
    		Directory.CreateDirectory(projectsDirectory);
    	}
    
    	// TODO: Set the source and target language combination
    	var sourceLanguage = "en-US"; // Change this to match the source language
    	var targetLanguage = "it-IT"; // Change this to match the target language
    
    	// TODO: Set the memory resource
    	var memory = new MemoryResource
    	{
            //Example to connect to deepL provider (https://appstore.rws.com/Plugin/24)
            Uri = new Uri("deepltranslationprovider:///"),
            UserNameOrClientId = "[your DeepL account e-mail]",
            Credential = "[your DeepL account API key]"
        };
    
    	CreateProject(sourceFilesDirectory, projectsDirectory, sourceLanguage, targetLanguage, memory);
    
    	Console.WriteLine("Done!");
    	Console.ReadLine();
    }

    let me know how it goes