You are currently working on UAT 

Automated translation with project templates from API not working

Dear all, 

what I'm trying to solve is to create translation projects through the Studio API, and I use a project template as the basis for the new project.

The project template contains a TM and the SDL BeGlobal Automated Translation provider as translation sources. In the template, I set up "Apply automated translation" when no match is found. If I use this template to create a new project from Studio, the BeGlobal is used prefectly during the pretranslation. However, if I do the same through the API, BeGlobal is not applied and this is the problem. It is added to the project as a translation provider, but it is not used in the Pretranslation phase, just the TM. If I open the created project in studio, and click on "Batch task -> Pretranslate files -> Finish" on the target file, then BeGlobal is applied, and the target segments are filled. This is all the sample code I use:

var pi = new ProjectInfo();
pi.Name = "Test";
pi.LocalProjectFolder = @"d:\temp\sdlprojects\Test5";
var ptl = new ProjectTemplateReference(@"C:\Users\mesztam\Documents\Studio 2011\Project Templates\Test.sdltpl");
var fbp = new FileBasedProject(pi, ptl);
var pf = fbp.AddFiles(new string[] { @"d:\test2.txt" })[0];
fbp.SetFileRole(new Guid[] { pf.Id }, FileRole.Translatable);
fbp.Save();
fbp.RunAutomaticTasks(new[] {pf.Id}, new[] {
"Sdl.ProjectApi.AutomaticTasks.Scan", "Sdl.ProjectApi.AutomaticTasks.Conversion", "Sdl.ProjectApi.AutomaticTasks.Split"});
var tlf= fbp.GetTargetLanguageFiles()[0];
fbp.RunAutomaticTasks(new[] { tlf.Id }, new[] { "Sdl.ProjectApi.AutomaticTasks.Analysis", "Sdl.ProjectApi.AutomaticTasks.Translate" });
fbp.Save();

I would apprechiate any ideas. Or is this an API bug?

thanks in advance,

Tamas

Parents Reply Children
No Data