mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 22:42:38 +01:00
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:
parent
5f1cce7356
commit
d3285cd167
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user