From 932d168b6eec11f9439fa3eedafeaeecec259e02 Mon Sep 17 00:00:00 2001 From: Ivandro Jao Date: Sat, 24 Feb 2024 20:27:52 +0000 Subject: [PATCH] Avoid replacing punctuation for French in FixDoubleDash This commit introduces a conditional to prevent replacing ellipsis followed by a question mark or exclamation mark with no space in between, specifically for French language. This change was deemed necessary as the original punctuation format is commonly used in French typography. --- src/libse/Forms/FixCommonErrors/FixDoubleDash.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libse/Forms/FixCommonErrors/FixDoubleDash.cs b/src/libse/Forms/FixCommonErrors/FixDoubleDash.cs index 461680dc3..8a6884361 100644 --- a/src/libse/Forms/FixCommonErrors/FixDoubleDash.cs +++ b/src/libse/Forms/FixCommonErrors/FixDoubleDash.cs @@ -35,8 +35,12 @@ namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors text = text.TrimEnd(); text = text.Replace("... " + Environment.NewLine, "..." + Environment.NewLine); text = text.Replace("... , ... - text = text.Replace("... ?", "...?"); - text = text.Replace("... !", "...!"); + + if (callbacks.Language != "fr") + { + text = text.Replace("... ?", "...?"); + text = text.Replace("... !", "...!"); + } if (text.IndexOf(Environment.NewLine, StringComparison.Ordinal) > 1) {