Make "Fix dialogs via dialog style" work with Jorean, Chinese, Japanse, Thai - thx Jamakmake :)

(does not require a sentence ending like a period)
This commit is contained in:
Nikolaj Olsson 2020-04-05 15:03:03 +02:00
parent 5f1cce7356
commit d3285cd167

View File

@ -1,4 +1,5 @@
using Nikse.SubtitleEdit.Core.Interfaces;
using System.Collections.Generic;
using Nikse.SubtitleEdit.Core.Interfaces;
namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
{
@ -9,7 +10,7 @@ namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
var language = Configuration.Settings.Language.FixCommonErrors;
string fixAction = string.Format(language.FixHyphensInDialogs, Configuration.Settings.General.DialogStyle);
int iFixes = 0;
var dialogHelper = new DialogSplitMerge { DialogStyle = Configuration.Settings.General.DialogStyle };
var dialogHelper = new DialogSplitMerge { DialogStyle = Configuration.Settings.General.DialogStyle, AllowDialogWithNoSentenceEnding = IsLanguageWithoutPeriods(callbacks.Language) };
for (int i = 0; i < subtitle.Paragraphs.Count; i++)
{
var p = subtitle.Paragraphs[i];
@ -27,5 +28,10 @@ namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
}
callbacks.UpdateFixStatus(iFixes, fixAction, language.XHyphensInDialogsFixed);
}
private static bool IsLanguageWithoutPeriods(string language)
{
return new List<string> { "ko", "zh", "ja", "th" }.Contains(language);
}
}
}