Fix for auto br line / French - thx Norbert :)

This commit is contained in:
niksedk 2021-06-21 15:34:50 +02:00
parent 14ccc6960e
commit 6026ab6989
2 changed files with 20 additions and 2 deletions

View File

@ -64,6 +64,15 @@ namespace Test.Logic
Assert.AreEqual(s1, s2);
}
[TestMethod]
public void AutoBreakFrenchSpaceBeforePunctuation()
{
Configuration.Settings.General.SubtitleLineMaximumLength = 43;
string s1 = "Et elle te le dis maintenant ? Pour quoi donc ?";
string s2 = Utilities.AutoBreakLine(s1, "fr");
Assert.AreEqual("Et elle te le dis maintenant ?" + Environment.NewLine + "Pour quoi donc ?", s2);
}
[TestMethod]
public void AutoBreakLine5DoNoBreakAtTwoMusicTaggedLines()
{

View File

@ -248,6 +248,15 @@ namespace Nikse.SubtitleEdit.Core.Common
return false;
}
if (nextChar == ' ' && language == "fr" && index + 1 < s.Length)
{
var nextNext = s[index + 1];
if (nextNext == '?' || nextNext == '!' || nextNext == '.')
{
return false;
}
}
return true;
}