This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tmExporter = new ScheduledServerTranslationMemoryExport(languageDirection){ | |
ContinueOnError = true | |
}; | |
tmExporter.Queue(); | |
tmExporter.Refresh(); | |
var continueWaiting = true; | |
while (continueWaiting){ | |
switch (tmExporter.Status){ | |
case ScheduledOperationStatus.Abort: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach (var tm in translationMemories){ | |
var tmPath = tm.ParentResourceGroupPath == "/" ? "" : tm.ParentResourceGroupPath; | |
var path = tmPath + "/" + tm.Name; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var translationProviderServer = new TranslationProviderServer(uri, false, UserName,Password); | |
var translationMemories = translationProviderServer.GetTranslationMemories(TranslationMemoryProperties.None); //get a list with all the tms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach (var translationUnit in tus){ | |
foreach (var element in translationUnit.SourceSegment.Elements.ToList()){ | |
var visitor = new SegmentElementVisitor(); | |
element.AcceptSegmentElementVisitor(visitor); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tm =new FileBasedTranslationMemory(tmPath); | |
var tmIterator = new RegularIterator(); | |
var tus = tm.LanguageDirection.GetTranslationUnits(ref tmIterator); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tag = IDocumentItemFactory.CreatePlaceholderTag(IPropertiesFactory.CreatePlaceholderTagProperties("text which should be displayed")); | |
tag.Properties.SetMetaData("customKey", "customValue"); //how to set custom metadata on your tag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void VisitText(IText text){ | |
text.Properties.Text = "New text we add to segment"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void VisitSegment(ISegment segment){ | |
VisitChildren(segment); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void VisitChildren(IAbstractMarkupDataContainer container){ | |
if (container == null) | |
return; | |
foreach (var item in container.ToList()){ | |
item.AcceptVisitor(this); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void VisitTextMethod(ISegment segment){ | |
VisitChildren(segment); | |
} |