How to batch modify (many many) project templates

As an agency we have accumulated a great number of project templates over the years. 

Looking back we would like to standardize them with regard to specific settings (such as TM search settings, file type sequence and configuration, match optimization, analysis and pre-translate settings etc.) 

Is there a tool or another good way to modify specific settings to several templates in batch

Parents
  • Hi ,

    I heard a similar request from another agency this morning... funny how things come up together like this. Must be the time of year!

    I'm not aware of a tool but I think it's a very good idea and worth someone (possibly our AppStore team when they get time) looking at. The UI would be interesting but I think having the capability to manage your template settings in one go would be very handy. I guess an app that would do this might not be too complicated in terms of the UI and still be very useful:

    - Show all the possible settings in a project template that could be stored as another special template
    - add a number of templates with an option to ignore languages perhaps or group by matching languages
    - apply the settings in the special template to all selected project templates

    Paul Filkin | RWS Group

    ________________________
    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

  • Hey Paul
    Do you know if this is supported by the API or would it be someone "digging" through the XML?
    I know that Andrew has done a few things like this to get around the bugs in the API, but that was always a bit cumbersome.
  • Hi , I'm not sure but probably knows as she is building some improvements to T-Windows at the moment and including the ability to handle project templates.

    Paul Filkin | RWS Group

    ________________________
    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

  •   

    Hello,

    You can have a look on the ApplyStudioProjectTemplate solution which is manipulating project templates. It can be found on GitHub https://github.com/sdl/Sdl-Community/tree/master/ApplyStudioProjectTemplate . Indeed, I am currently working on getting settings from the project template without "digging" too much through XML, in order to do this it is needed to first create a project, assign the template to it and after that you can get the settings from the template through Api's: Sdl.ProjectAutomation.Core, Sdl.ProjectAutomation.FileBased, Sdl.LanguagePlatform.TranslationMemoryApi. In order to add the template to a project and get a part of the settings from it you can guide from the following sample code:

    ProjectTemplateReference projTemplate = new ProjectTemplateReference(applyProjectTemplate.Uri.LocalPath); //applyProjectTemplate.Uri.LocalPath represents the local path of the template from the user's local machine.

    var projectInfo = new ProjectInfo
    {
    Name = "ProjectTemplateTWindow",
    SourceLanguage = sourceLanguage
    LocalProjectFolder = projectPath,
    TargetLanguages = targetLanguage
    };

    // Create project based by the default template selected by the user.
    var project = new FileBasedProject(projectInfo, projTemplate);
    project.Save();

    // Get settings from the project template
    var settings = project.GetSettings();
    var tmSettings = settings.GetSettingsGroup<TranslationMemorySettings>();

    // Set the Penalties settings from the template
    MulitplyTranslationPenalty = tmSettings.MultipleTranslationsPenalty.Value;
    MissingFormattingPenalty = tmSettings.MissingFormattingPenalty.Value;
    DifferentFormattingPenalty = tmSettings.DifferentFormattingPenalty.Value;
    AutoLocalizationPenalty = tmSettings.AutoLocalizationPenalty.Value;
    TextReplacementPenalty = tmSettings.TextReplacementPenalty.Value;

    // Set the Search settings from the template
    MinScore = tmSettings.TranslationMinimumMatchValue.Value;
    MaxResults = tmSettings.TranslationMaximumResults.Value;
    MinConcordanceScore = tmSettings.ConcordanceMinimumMatchValue.Value;
    MaxConcordanceResults = tmSettings.ConcordanceMaximumResults.Value;

     

     

    With kind regards,

    Florentina-Lucia Caputa

    With kind regards,

    Florentina Caputa

Reply
  •   

    Hello,

    You can have a look on the ApplyStudioProjectTemplate solution which is manipulating project templates. It can be found on GitHub https://github.com/sdl/Sdl-Community/tree/master/ApplyStudioProjectTemplate . Indeed, I am currently working on getting settings from the project template without "digging" too much through XML, in order to do this it is needed to first create a project, assign the template to it and after that you can get the settings from the template through Api's: Sdl.ProjectAutomation.Core, Sdl.ProjectAutomation.FileBased, Sdl.LanguagePlatform.TranslationMemoryApi. In order to add the template to a project and get a part of the settings from it you can guide from the following sample code:

    ProjectTemplateReference projTemplate = new ProjectTemplateReference(applyProjectTemplate.Uri.LocalPath); //applyProjectTemplate.Uri.LocalPath represents the local path of the template from the user's local machine.

    var projectInfo = new ProjectInfo
    {
    Name = "ProjectTemplateTWindow",
    SourceLanguage = sourceLanguage
    LocalProjectFolder = projectPath,
    TargetLanguages = targetLanguage
    };

    // Create project based by the default template selected by the user.
    var project = new FileBasedProject(projectInfo, projTemplate);
    project.Save();

    // Get settings from the project template
    var settings = project.GetSettings();
    var tmSettings = settings.GetSettingsGroup<TranslationMemorySettings>();

    // Set the Penalties settings from the template
    MulitplyTranslationPenalty = tmSettings.MultipleTranslationsPenalty.Value;
    MissingFormattingPenalty = tmSettings.MissingFormattingPenalty.Value;
    DifferentFormattingPenalty = tmSettings.DifferentFormattingPenalty.Value;
    AutoLocalizationPenalty = tmSettings.AutoLocalizationPenalty.Value;
    TextReplacementPenalty = tmSettings.TextReplacementPenalty.Value;

    // Set the Search settings from the template
    MinScore = tmSettings.TranslationMinimumMatchValue.Value;
    MaxResults = tmSettings.TranslationMaximumResults.Value;
    MinConcordanceScore = tmSettings.ConcordanceMinimumMatchValue.Value;
    MaxConcordanceResults = tmSettings.ConcordanceMaximumResults.Value;

     

     

    With kind regards,

    Florentina-Lucia Caputa

    With kind regards,

    Florentina Caputa

Children