private bool IsImprovementToTpTranslation(ITranslationOrigin translationOrigin, SegmentId segmentId, ISegment segment) { return(translationOrigin?.OriginBeforeAdaptation?.OriginSystem == PluginResources.SDLMTCloudName && ActiveDocumentImprovements.ContainsKey(segmentId) && ActiveDocumentImprovements[segmentId].OriginalMtCloudTranslation != segment.ToString() && segment.Properties?.ConfirmationLevel == ConfirmationLevel.Translated); }
public Feedback GetImprovement(SegmentId?segmentId = null) { var currentSegment = segmentId ?? ActiveDocument.ActiveSegmentPair?.Properties.Id; Feedback improvement = null; var segmentHasImprovement = currentSegment != null && ActiveDocumentImprovements.ContainsKey(currentSegment.Value); if (segmentHasImprovement) { improvement = ActiveDocumentImprovements[currentSegment.Value]; } return(improvement); }
public void AddImprovement(SegmentId segmentId, string improvement) { if (!ActiveDocumentImprovements.ContainsKey(segmentId)) { return; } var item = ActiveDocumentImprovements[segmentId]; if (item.Suggestion != improvement) { item.Suggestion = improvement; } }