Skip to content

Instantly share code, notes, and snippets.

@cromica
Created December 12, 2014 15:01
Show Gist options
  • Select an option

  • Save cromica/1a94eb68741b1d21e67d to your computer and use it in GitHub Desktop.

Select an option

Save cromica/1a94eb68741b1d21e67d to your computer and use it in GitHub Desktop.
Add Translation Memory to a project using Studio SDK
//create a translation provider entry and specify the path to the tm
var entry = new TranslationProviderCascadeEntry(@"path to the tm", true, true, true);
//get default project translation provider configuration
var providerConfiguration = project.GetTranslationProviderConfiguration();
//override project default settings in order to allow us to specify tm's
providerConfiguration.OverrideParent = true;
//add the translation provider to the configuration
providerConfiguration.Entries.Add(entry);
//set tm for all language pairs
project.UpdateTranslationProviderConfiguration(providerConfiguration);
//if you want to add the tm per languague pair use the commented code instead of the above line
//foreach (var item in project.GetProjectInfo().TargetLanguages)
//{
// project.AddMasterTM(providerConfiguration, item.IsoAbbreviation);
//}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment