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
  • Unknown said:
    With the version 3.0 of this plugin, not all segments were translated.
    ...
    The segments of the target sdlxliff file were unfortunately not filled. They were only stored as "draft".

    So was it only some (i.e. "not all") or actually all of them?

    Unknown said:
    Please help me that my program is working.

    If you then open the created project in Studio and apply pretranslate task, does it work or not?
    That would give you a clue whether there is something wrong with running the task itself, or with some settings.

    Unknown said:
    I tested with an 1 MB file. In both versions 1.9 and 3.0 they need a lot of time to be processed.

    Please be more specific - what exactly is "lot of time" and why do you think it's too much?
    As Paul mentioned, do you realize how the cloud MT providers work (i.e. that Studio sends every segment separately up to the cloud via Internet and has to wait for each individual response, again received over Internet) and that such process by its nature cannot be made faster (plus, it's heavily influenced by each individual user's Internet connectivity)?

  • In Trados Studio and in my program, some segments were not translated with version 3.0. With version 1.9, all segments were translated in Trados Studio, but my program doesn't do it. I couldn't figure out why. The internet connectivity isn't the issue. I had to wait for an 1MB file around 3-4 minutes. The segments should somehow be bundled to reduce the number of server calls or the server calls should be parallelized. Parallel server access is possible.

Reply Children