DeepL plugin usage in C# programs

Hi,

in my company, we use SDL Trados Studio 2017 SR1 (Version 14.1.10011.20356)  in combination with the DeepL plugin. With the version 3.0 of this plugin, not all segments were translated. Version 1.9 seems to work in SDL Studio. But, I was unable to use it for a pretranslate task in C#, what was still possible with version 3.0 and the described errors like in SDL Trados Studio: 

 

FileBasedProject fileP = new FileBasedProject(@"path and file name of the project");
ISettingsBundle settings = fileP.GetSettings();

#region pretranslate settings

ISettingsBundle settings = fileP.GetSettings();
TranslateTaskSettings preTranslateSettings = settings.GetSettingsGroup<TranslateTaskSettings>();
preTranslateSettings.ConfirmAfterApplyingExactMatch.Value = true;
preTranslateSettings.ConfirmAfterApplyingInContextExactMatch.Value = true;
preTranslateSettings.CreateReport.Value = true;
preTranslateSettings.LockContextMatchSegments.Value = false;
preTranslateSettings.LockExactMatchSegments.Value = false;
preTranslateSettings.MinimumMatchScore.Value = 100;
preTranslateSettings.NoTranslationMemoryMatchFoundAction.Value = NoTranslationMemoryMatchFoundAction.ApplyAutomatedTranslation;
preTranslateSettings.OverwritePerfectMatch.Value = true;
preTranslateSettings.TranslationOverwriteMode.Value = TranslationUpdateMode.OverwriteExistingTranslation;

fileP.UpdateSettings(fileP.GetTargetLanguageFiles()[0].Language, settings);

#endregion

 

var originalUri = new Uri("deepltranslationprovider:///");

TranslationProviderConfiguration config = fileP.GetTranslationProviderConfiguration();
TranslationProviderCascadeEntry tpce = new TranslationProviderCascadeEntry
            (
                  new TranslationProviderReference(originalUri), false, true, true, 0
            );

config.Entries.Add(tpce);
fileP.Credentials.AddCredential(originalUri, "api key");
fileP.UpdateTranslationProviderConfiguration(config);

 //pretranslate only the file with index 2 

AutomaticTask analyzeTask = fileP.RunAutomaticTask(
                new Guid[] { fileP.GetTargetLanguageFiles()[2].Id },
                AutomaticTaskTemplateIds.PreTranslateFiles);

The segments of the target sdlxliff file were unfortunately not filled. They were only stored as "draft". Please help me that my program is working.

Another problem are large files. I tested with an 1 MB file. In both versions 1.9 and 3.0 they need a lot of time to be processed. It would be nice if the plugin could be modified to work faster.  

 

Many regards,
Andreas Meisel

Parents
  • Hi

    We left both versions on the appstore because version 3.0 added some new features that caused a problem for some users (not all). Once the developer returns from leave we'll investigate this and fix version 3. This could be part of the problem you are having.

    On the making it go faster... pretranslating files with MT in Studio generally takes a while we can't improve this in the plugin itself as we have to use the Studio API for the provider. Another factor would be the speed of the response over your internet connection.

    Paul Filkin | RWS

    Design your own training!
    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

Reply
  • Hi

    We left both versions on the appstore because version 3.0 added some new features that caused a problem for some users (not all). Once the developer returns from leave we'll investigate this and fix version 3. This could be part of the problem you are having.

    On the making it go faster... pretranslating files with MT in Studio generally takes a while we can't improve this in the plugin itself as we have to use the Studio API for the provider. Another factor would be the speed of the response over your internet connection.

    Paul Filkin | RWS

    Design your own training!
    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

Children