Template settings copied to project but not implemented

We have a template with specific parsing instructions for HTML specified in the settings:

Screenshot of Trados Studio Project Template Settings showing a list of HTML parsing rules such as 'bold', 'italic', 'underline' with their respective conditions and formatting.

We have an in-house developed Trados plugin which creates projects and we've found that projects created using this template do not have these segmentation rules applied.

The rules are in the project file - here is a screenshot of the relevant section...

Screenshot of an XML file with Trados Studio project settings highlighting the 'SettingsBundle' section with various 'SettingsGroup' IDs including 'FileTypeManagerConfiguration' and 'Html 5 2.8.0.0'.

But when opened in Trados, the segments have not been parsed according to these rules.

Is there an additional function call needed to apply such rules? I know it's far from comprehensive but this is basically how we create the project:

private FileBasedProject CreateProjectFromTemplate(FileBasedProjectSettings settings)
{
    var template = new ProjectTemplateReference(settings.Template.FullName);

    // create new project object
    FileBasedProject createdProject;
    try
    {
        createdProject = new FileBasedProject(settings.ProjectInfo, template);
        _reporter.Info("Project created.");
    }
    catch (Exception exception)
    {
        _reporter.Error("An exception occurred while creating the FileBasedProject", exception);
        throw new Exception($"An exception occurred while creating the FileBasedProject: {exception.Message}");
    }

    // configure the analysis settings
    FormulateAnalysisSettings(createdProject);

    // add files
    AddFiles(createdProject, settings.InputDir);

    // start the tasks
    RunTasks(createdProject, settings);
    _reporter.Info("All tasks completed.");

    // set the value for the 'Auftragsnummer' field
    _tmUtils.UpdateOrderNumberField(createdProject,
                                    tms,
                                    settings.ProjectInfo.TargetLanguages,
                                    settings.OrderId,
                                    _reporter);

    createdProject.Save();
    _reporter.Info($"Project saved to \"{settings.ProjectInfo.LocalProjectFolder}\".");

    if (!settings.CreatePackage)
    {
        return createdProject;
    }

    CreateProjectPackage(createdProject, settings);

    return createdProject;
}

The tasks which are run are:

  • Scan (Sdl.ProjectApi.AutomaticTasks.Scan)
  • ConvertToTranslatableFormat (Sdl.ProjectApi.AutomaticTasks.Conversion)
  • CopyToTargetLanguages (Sdl.ProjectApi.AutomaticTasks.Split)
  • PerfectMatch (Sdl.ProjectApi.AutomaticTasks.PerfectMatch)
  • PreTranslateFiles (Sdl.ProjectApi.AutomaticTasks.Translate)
  • AnalyzeFiles (Sdl.ProjectApi.AutomaticTasks.Analysis)
  • PopulateProjectTranslationMemories (Sdl.ProjectApi.AutomaticTasks.ProjectTm)

If there's any of the inner function calls which you'd like more details of, please ask.



Generated Image Alt-Text
[edited by: Trados AI at 1:10 PM (GMT 0) on 5 Mar 2024]
Parents Reply
  • Hi Emanuel,

    Our problem has mysteriously fixed itself. A problem that was easily repeatable last week can no longer be replicated. The only difference is that the user who reported the problem has upgraded from Trados 2017 to 2019 in the meantime, but the code for our plugin has seen no changes throughout this process (aside from having the SDL libraries re-referenced to the \Studio15 directory).

    Thanks very much for putting the sample project together - I did take a look and the only fundamental difference between your code and mine is that you run the default task sequence whereas I specify the same individual tasks.

    Anyway, thanks again, I appreciate the time you spent on this.
Children