示例#1
0
 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);
 }
示例#2
0
        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);
        }
示例#3
0
        public void AddImprovement(SegmentId segmentId, string improvement)
        {
            if (!ActiveDocumentImprovements.ContainsKey(segmentId))
            {
                return;
            }

            var item = ActiveDocumentImprovements[segmentId];

            if (item.Suggestion != improvement)
            {
                item.Suggestion = improvement;
            }
        }