Example #1
0
        public SegmentPair()
        {
            Id                = string.Empty;
            ParagraphId       = string.Empty;
            ConfirmationLevel = string.Empty;

            IsLocked = false;

            Source = string.Empty;
            Target = string.Empty;

            SourceSections         = new List <SegmentSection>();
            TargetSections         = new List <SegmentSection>();
            TargetModifiedSections = new List <SegmentSection>();

            Origin = new TranslationOrigin();

            Comments = new List <Comment>();


            SourceWords      = 0;
            SourceChars      = 0;
            SourceTags       = 0;
            SourcePlaceables = 0;

            RevisionMarkerUniqueIds = new List <string>();
        }
Example #2
0
        public static string GetTranslationStatus(TranslationOrigin translationOrigin)
        {
            var match = string.Empty;

            if (translationOrigin != null)
            {
                if (string.Compare(translationOrigin.OriginType, "interactive", StringComparison.OrdinalIgnoreCase) == 0)
                {
                    //match = translationOrigin.matchPercentage.ToString();
                }
                else
                {
                    if (translationOrigin.MatchPercentage >= 100)
                    {
                        if (string.Compare(translationOrigin.OriginType, "document-match", StringComparison.OrdinalIgnoreCase) == 0)
                        {
                            match = "PM";
                        }
                        else if (string.Compare(translationOrigin.TextContextMatchLevel, "SourceAndTarget", StringComparison.OrdinalIgnoreCase) == 0)
                        {
                            match = "CM";
                        }
                        else if (string.Compare(translationOrigin.OriginType, "mt", StringComparison.OrdinalIgnoreCase) == 0 ||
                                 string.Compare(translationOrigin.OriginType, "amt", StringComparison.OrdinalIgnoreCase) == 0)
                        {
                            match = "AT";
                        }
                        else
                        {
                            match = translationOrigin.MatchPercentage + "%";
                        }
                    }
                    else if (string.Compare(translationOrigin.OriginType, "mt", StringComparison.OrdinalIgnoreCase) == 0 ||
                             string.Compare(translationOrigin.OriginType, "amt", StringComparison.OrdinalIgnoreCase) == 0)
                    {
                        match = "AT";
                    }
                    else if (translationOrigin.MatchPercentage > 0)
                    {
                        match = translationOrigin.MatchPercentage + "%";
                    }
                    else
                    {
                        match = string.Empty;
                    }
                }
            }
            return(match);
        }