Exemplo n.º 1
0
        public void Fix(Subtitle subtitle, IFixCallbacks callbacks)
        {
            string fixAction      = Language.MergeShortLine;
            int    noOfShortLines = 0;

            for (int i = 0; i < subtitle.Paragraphs.Count; i++)
            {
                Paragraph p       = subtitle.Paragraphs[i];
                string    oldText = p.Text;
                var       text    = Helper.FixShortLines(p.Text, callbacks.Language);
                if (callbacks.AllowFix(p, fixAction) && oldText != text)
                {
                    p.Text = text;
                    noOfShortLines++;
                    callbacks.AddFixToListView(p, fixAction, oldText, p.Text);
                }
            }
            callbacks.UpdateFixStatus(noOfShortLines, fixAction);
        }
Exemplo n.º 2
0
        public void Fix(Subtitle subtitle, IFixCallbacks callbacks)
        {
            var    language       = Configuration.Settings.Language.FixCommonErrors;
            string fixAction      = language.MergeShortLine;
            int    noOfShortLines = 0;

            for (int i = 0; i < subtitle.Paragraphs.Count; i++)
            {
                Paragraph p       = subtitle.Paragraphs[i];
                string    oldText = p.Text;
                var       text    = Helper.FixShortLines(p.Text, callbacks.Language);
                if (callbacks.AllowFix(p, fixAction) && oldText != text)
                {
                    p.Text = text;
                    noOfShortLines++;
                    callbacks.AddFixToListView(p, fixAction, oldText, p.Text);
                }
            }
            callbacks.UpdateFixStatus(noOfShortLines, language.RemoveLineBreaks, string.Format(language.XLinesUnbreaked, noOfShortLines));
        }