Skip to content

Instantly share code, notes, and snippets.

@cromica
Created May 20, 2015 11:30
Show Gist options
  • Save cromica/cf3f4772c08fb444c9f2 to your computer and use it in GitHub Desktop.
Save cromica/cf3f4772c08fb444c9f2 to your computer and use it in GitHub Desktop.
Sample code on how to add Groupshare TM in SDL Studio
var studioProject = new FileBasedProject(@"Project path");
var projectTargetLanguage = new Language("ES-ES");
TranslationProviderConfiguration tmConf =
studioProject.GetTranslationProviderConfiguration();
tmConf.OverrideParent = true;
tmConf.Entries.Add(
(
new TranslationProviderCascadeEntry
(
new TranslationProviderReference(
new Uri(String.Format("sdltm.{0}?orgPath={1}&tmName={2}", "http://sdldevelopmentpartners.sdlproducts.com/",
"/XTRF/TEST", "Default Translation Memory for EN-US to ES-ES for Customer C000001"))),
true,
true,
true,
0
)
));
string credential = String.Format("user={0};password={1};type=CustomUser", "test", "P@ssword!");
studioProject.Credentials.AddCredential(new Uri("sdltm." + "http://sdldevelopmentpartners.sdlproducts.com/"), credential);
studioProject.UpdateTranslationProviderConfiguration(projectTargetLanguage, tmConf);
studioProject.Save();
ProjectFile[] targetFiles = studioProject.GetTargetLanguageFiles();
studioProject.RunDefaultTaskSequence(targetFiles.Select(x=>x.Id).ToArray());
studioProject.Save();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment