DeepL in Project Automation

Hi everyone,

we have a Project Creation tool that we use to automatically create SDL Studio projects. This works great. And we really appreciate that this sort of stuff is possible. We've recently been trying to include DeepL as part of the pre-translation process. Initially we thought all we had to do was add DeepL as translation provider to the project template. This works fine for manually created projects. However, when I run the project creation process via our tool, PerfectMatch and Pretranslate from TM run fine. But there are no DeepL (NMT) translations. If I then run Pretranslate manually on the project, then the DeepL works. So this proves that DeepL is properly configured in the project settings.

What are we missing? Is this a limitation in the DeepL versions? We have a DeepL Pro account and a DeepL API account. We are using the DeepL Pro account in the project template. Is it not possible to automate project creation and have DeepL run automatically as part of the pre-translation process?

Thanks for any help.

Rob 

  • Hi Rob,

    I just recently dealt with something like this myself, so maybe I can help you out.

    Did you make sure to add the DeepL URI and your API Key to the credential store? You can do so by calling FileBasedProject.Credentials.AddCredential(Uri uri, string yourApiKey)

    The DeepL Plugin checks the credential store using some uri defined in the PlugIn resources. I believe the default uri is now "deepltranslationprovider:///".  In my case, the uri that we used when storing the credentials was wrong, but changing it to 'deepltranslationprovider:///' fixed the problem.

    Best

    Laurent

  • Hi , in addition to the response from which makes sense (tks Laurent), please also test by adding the provider programmatically from your project automation project as opposed to recovering it from the project template, for testing purposes.

    Substitute <api_key> with your valid API Key from DeepL

    private static void AddTranslationProvider(FileBasedProject project)
    {
           var uri_scheme = "deepltranslationprovider:///";
           var formality = "Default";
           var sendPlain = "False";
           var uri = new Uri($"{uri_scheme}?formality={formality}&sendPlain={sendPlain}");
     
           var tmConfig = project.GetTranslationProviderConfiguration();
           var provider = new TranslationProviderReference(uri, string.Empty, true);
           var entry = new TranslationProviderCascadeEntry(provider, false, true, true, 0);
           tmConfig.Entries.Add(entry);
           project.UpdateTranslationProviderConfiguration(tmConfig);
     
           var credential_uri_scheme = "deepltranslationprovider:///";
           var apiKey = "<api_key>";
           project.Credentials.AddCredential(new Uri(credential_uri_scheme), apiKey);
           project.Save();
    }