mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-23 03:33:18 +01:00
Improve "FixMissingSpaces" support for ko, zh, ja, th - thx Jamakmake :)
regarding dialogs
This commit is contained in:
parent
f78ee4cee2
commit
81abf9d2f3
@ -1,5 +1,6 @@
|
||||
using Nikse.SubtitleEdit.Core.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
|
||||
@ -21,7 +22,7 @@ namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
|
||||
string languageCode = callbacks.Language;
|
||||
string fixAction = language.FixMissingSpace;
|
||||
int missingSpaces = 0;
|
||||
var dialogHelper = new DialogSplitMerge { DialogStyle = Configuration.Settings.General.DialogStyle };
|
||||
var dialogHelper = new DialogSplitMerge { DialogStyle = Configuration.Settings.General.DialogStyle, AllowDialogWithNoSentenceEnding = IsLanguageWithoutPeriods(callbacks.Language) };
|
||||
const string expectedChars = @"""”<.";
|
||||
for (int i = 0; i < subtitle.Paragraphs.Count; i++)
|
||||
{
|
||||
@ -501,5 +502,9 @@ namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
|
||||
return text.Substring(startIndex, endIndex - startIndex + 1);
|
||||
}
|
||||
|
||||
private static bool IsLanguageWithoutPeriods(string language)
|
||||
{
|
||||
return new List<string> { "ko", "zh", "ja", "th" }.Contains(language);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user