diff --git a/Changelog.txt b/Changelog.txt index d864e5c72..19983a23d 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -9,6 +9,7 @@ * Add new json subtitle format - thx Lucretia * Add auto-translate via Papago * Add new shortcut "Set end and start of next after gap" - thx rRobis + * Allow configure of Whisper post-processing - thx raphaelomoreira * IMPROVED: * Update Polish translation - thx admas * Update Finnish translation - thx Teijo S @@ -32,6 +33,7 @@ * Only add recent file if saved - thx F5System * Fix for mouse wheel scroll direction in video player - thx Peter * Fix for ASSA border width in export to image based format - thx Christian + * Fix crash in generating ASSA borders with odd video resolution - thx Leon 4.0.2 (19th November 2023) diff --git a/Dictionaries/en_US_se.xml b/Dictionaries/en_US_se.xml index 0ea03e33c..290665329 100644 --- a/Dictionaries/en_US_se.xml +++ b/Dictionaries/en_US_se.xml @@ -940,4 +940,6 @@ yukina zinc zirconium + fenugreek + pled \ No newline at end of file diff --git a/Dictionaries/names.xml b/Dictionaries/names.xml index bcd17049f..9cb4e3ea8 100644 --- a/Dictionaries/names.xml +++ b/Dictionaries/names.xml @@ -2989,6 +2989,7 @@ This file is case sensitive. Katie Katrina Katrine + Katsumoto Katy Katya Kaufman diff --git a/src/libse/AutoTranslate/ChatGptTranslate.cs b/src/libse/AutoTranslate/ChatGptTranslate.cs index 3bef9a5e7..2a75e9428 100644 --- a/src/libse/AutoTranslate/ChatGptTranslate.cs +++ b/src/libse/AutoTranslate/ChatGptTranslate.cs @@ -27,7 +27,11 @@ namespace Nikse.SubtitleEdit.Core.AutoTranslate _httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json"); _httpClient.DefaultRequestHeaders.TryAddWithoutValidation("accept", "application/json"); _httpClient.BaseAddress = new Uri(Configuration.Settings.Tools.ChatGptUrl); - _httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Authorization", "Bearer " + Configuration.Settings.Tools.ChatGptApiKey); + + if (!string.IsNullOrEmpty(Configuration.Settings.Tools.ChatGptApiKey)) + { + _httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Authorization", "Bearer " + Configuration.Settings.Tools.ChatGptApiKey); + } } public List GetSupportedSourceLanguages() diff --git a/src/libse/Common/StringExtensions.cs b/src/libse/Common/StringExtensions.cs index 6f257b976..b708e78a3 100644 --- a/src/libse/Common/StringExtensions.cs +++ b/src/libse/Common/StringExtensions.cs @@ -758,7 +758,7 @@ namespace Nikse.SubtitleEdit.Core.Common private static readonly HashSet NeutralSentenceEndingChars = new HashSet { - '.', '!', '?', ']', ')', '…', '♪', '؟' + '.', '!', '?', ']', ')', '…', '♪', '؟', '。', '?' }; private static readonly HashSet GreekSentenceEndingChars = new HashSet diff --git a/src/ui/Forms/AudioToText/WhisperAudioToText.cs b/src/ui/Forms/AudioToText/WhisperAudioToText.cs index 16dece148..23ee129ae 100644 --- a/src/ui/Forms/AudioToText/WhisperAudioToText.cs +++ b/src/ui/Forms/AudioToText/WhisperAudioToText.cs @@ -419,6 +419,7 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText buttonAdvanced.Enabled = false; comboBoxLanguages.Enabled = false; comboBoxModels.Enabled = false; + linkLabelPostProcessingConfigure.Enabled = false; var waveFileName = GenerateWavFile(_videoFileName, _audioTrackNumber); if (_cancel) { @@ -2121,6 +2122,7 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText buttonAdvanced.Enabled = true; comboBoxLanguages.Enabled = true; comboBoxModels.Enabled = true; + linkLabelPostProcessingConfigure.Enabled = true; } } diff --git a/src/ui/Forms/AudioToText/WhisperAudioToTextSelectedLines.cs b/src/ui/Forms/AudioToText/WhisperAudioToTextSelectedLines.cs index ca58dfa79..8e0d43e1e 100644 --- a/src/ui/Forms/AudioToText/WhisperAudioToTextSelectedLines.cs +++ b/src/ui/Forms/AudioToText/WhisperAudioToTextSelectedLines.cs @@ -128,6 +128,7 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText groupBoxInputFiles.Enabled = false; comboBoxLanguages.Enabled = false; comboBoxModels.Enabled = false; + linkLabelPostProcessingConfigure.Enabled = false; _batchFileNumber = 0; var postProcessor = new AudioToTextPostProcessor(_languageCode) { @@ -148,6 +149,7 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText buttonGenerate.Enabled = false; buttonDownload.Enabled = false; comboBoxModels.Enabled = false; + linkLabelPostProcessingConfigure.Enabled = false; comboBoxLanguages.Enabled = false; var waveFileName = videoFileName; diff --git a/src/ui/Forms/SeMsgBox/MessageBoxForm.cs b/src/ui/Forms/SeMsgBox/MessageBoxForm.cs index 3cbef7dd1..e08376cc0 100644 --- a/src/ui/Forms/SeMsgBox/MessageBoxForm.cs +++ b/src/ui/Forms/SeMsgBox/MessageBoxForm.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Drawing; using System.IO; +using System.Linq; using System.Windows.Forms; namespace Nikse.SubtitleEdit.Forms.SeMsgBox @@ -126,7 +127,7 @@ namespace Nikse.SubtitleEdit.Forms.SeMsgBox text = string.Empty; } - if (text.Length > 500) + if (ShouldSwitchToTextBox(text)) { seTextBox2.ReadOnly = true; seTextBox2.Text = text; @@ -149,6 +150,22 @@ namespace Nikse.SubtitleEdit.Forms.SeMsgBox labelText.Text = text; } + private bool ShouldSwitchToTextBox(string text) + { + if (text.Length > 500) + { + return true; + } + + var arr = text.SplitToLines(); + if (arr.Any(p => p.Length > 140)) + { + return true; + } + + return false; + } + private void InitializeButtons(MessageBoxButtons buttons) { var buttonControls = new List