Пример #1
0
        public void Patch(TranslationModuleDiff tpDiff)
        {
            var byLanguage = Segments.ByLanguage();

            foreach (var diff in tpDiff.DiffPerLanguage)
            {
                diff.Value.Patch(_Segments, byLanguage[diff.Key]);
            }
        }
Пример #2
0
        public TranslationModuleDiff Diff(ITranslationModule tp)
        {
            var allSync = new Dictionary <string, SegmentDiff>();


            foreach (var l in Segments.ByLanguage())
            {
                //if (!Dicts.ContainsKey(l) || !tp.Dicts.ContainsKey(l)) continue;
                var segDiff = new SegmentDiff();
                segDiff.Diff(l, tp.ByLanguage[l.Key]);
                allSync.Add(l.Key, segDiff);
            }

            /*
             * foreach (var l in Languages)
             * {
             *      if (!Dicts.ContainsKey(l) || !tp.Dicts.ContainsKey(l)) continue;
             *      allSync.Add(l, DictDiff.Diff(Dicts[l], tp.Dicts[l]));
             * }
             */
            return(new TranslationModuleDiff(allSync));
        }