Sdl Sdk Project Automation Use Template and PreTranslateFiles using Server Based Translation Memories

How is it possible to run AutomaticTask.PreTranslateFiles, using server based Translation Memories?

MainTranslationProviderItem Uri="sdltm.gsdemo.gs.sdlproducts.com/ Global Solution Consultants%2FBC Translation Productivity%2FSDL EMEA LSP%2FSDL LSP Trials%2F{CompanyName}&tmName={TmName}" Enabled="true
private void RunAutomaticTask(FileBasedProject ThisSdlProject, string TargetLanguageCode){
    ProjectFile[] targetFiles = ThisSdlProject.GetTargetLanguageFiles(new Language(CultureInfo.GetCultureInfo(TargetLanguageCode)));
    AutomaticTask preTranslate = ThisSdlProject.RunAutomaticTask(targetFiles.GetIds(), AutomaticTaskTemplateIds.PreTranslateFiles);
}

I get the error: "The current parameters are not compatible with the Translation Provider Uri Schema"

Parents Reply
  • Hi Emanuel,

    I didn't create the Uri manually, the example in my post is what is exactly in the Sdl Project Template file.

    So I don't want to add a server Tm as it is already defined within the template.

    I am currently getting errors when using the template that already contains references to server Tms.

    Is it just a case then of adding the server credentials?..:

    project.Credentials.AddCredential(new Uri(serverAddress),
    	$"user={username};password={password};type={(useWindowsSecurity ? "WindowsUser" : "CustomUser")}");
    project.UpdateTranslationProviderConfiguration(config);

    Thanks for your advice

Children