From f9ca62b55fd3aa9ebaeb1d1ed045b32b55a7fd93 Mon Sep 17 00:00:00 2001 From: niksedk Date: Sat, 16 Sep 2023 10:04:43 +0200 Subject: [PATCH] Minor language fix - thx domddol :) --- LanguageBaseEnglish.xml | 1 + src/ui/Controls/NikseTimeUpDown.cs | 1 - src/ui/Forms/Main.cs | 8 ++++---- src/ui/Logic/Language.cs | 1 + src/ui/Logic/LanguageDeserializer.cs | 3 +++ src/ui/Logic/LanguageStructure.cs | 1 + 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/LanguageBaseEnglish.xml b/LanguageBaseEnglish.xml index 77f3dfa00..aea2bb544 100644 --- a/LanguageBaseEnglish.xml +++ b/LanguageBaseEnglish.xml @@ -217,6 +217,7 @@ Read more info (web)? Set CPP/Const-me models folder... Run only post-processing/adjust timings Download cuBLAS and cuDNN libs for Faster-Whisper + No text found! Advanced Sub Station Alpha attachments diff --git a/src/ui/Controls/NikseTimeUpDown.cs b/src/ui/Controls/NikseTimeUpDown.cs index 9dcf0550f..c1bc4f104 100644 --- a/src/ui/Controls/NikseTimeUpDown.cs +++ b/src/ui/Controls/NikseTimeUpDown.cs @@ -7,7 +7,6 @@ using System.Drawing; using System.Drawing.Drawing2D; using System.Globalization; using System.Windows.Forms; -using static System.Windows.Forms.VisualStyles.VisualStyleElement; namespace Nikse.SubtitleEdit.Controls { diff --git a/src/ui/Forms/Main.cs b/src/ui/Forms/Main.cs index b8295fd2d..8fffd7863 100644 --- a/src/ui/Forms/Main.cs +++ b/src/ui/Forms/Main.cs @@ -35370,7 +35370,7 @@ namespace Nikse.SubtitleEdit.Forms if (form.TranscribedSubtitle.Paragraphs.Count == 0) { - MessageBox.Show("No text found!"); + MessageBox.Show(LanguageSettings.Current.AudioToText.NoTextFound); return; } @@ -35547,7 +35547,7 @@ namespace Nikse.SubtitleEdit.Forms { if (form.IncompleteModel) { - MessageBox.Show($"No text found - model incomplete.{Environment.NewLine}" + + MessageBox.Show($"Model incomplete.{Environment.NewLine}" + $"Please re-download model: {form.IncompleteModelName}", MessageBoxIcon.Error); } else if (form.UnknownArgument) @@ -35580,8 +35580,8 @@ namespace Nikse.SubtitleEdit.Forms { extraMessage = Environment.NewLine + "Note you have a custom argument: " + customArgument; } - extraMessage = extraMessage + Environment.NewLine + Environment.NewLine + "View the log file `whisper_log.txt`?"; - var r = MessageBox.Show($"No text found!" + extraMessage, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Error); + extraMessage = extraMessage + Environment.NewLine + Environment.NewLine + string.Format(LanguageSettings.Current.General.ViewX, "`whisper_log.txt`?"); + var r = MessageBox.Show(LanguageSettings.Current.AudioToText.NoTextFound + extraMessage, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Error); if (r == DialogResult.Yes) { UiUtil.OpenFile(SeLogger.GetWhisperLogFilePath()); diff --git a/src/ui/Logic/Language.cs b/src/ui/Logic/Language.cs index c0d7c57f6..451fdef1f 100644 --- a/src/ui/Logic/Language.cs +++ b/src/ui/Logic/Language.cs @@ -369,6 +369,7 @@ namespace Nikse.SubtitleEdit.Logic SetCppConstMeFolder = "Set CPP/Const-me models folder...", OnlyRunPostProcessing = "Run only post-processing/adjust timings", DownloadFasterWhisperCuda = "Download cuBLAS and cuDNN libs for Faster-Whisper", + NoTextFound = "No text found!", }; AssaAttachments = new LanguageStructure.AssaAttachments diff --git a/src/ui/Logic/LanguageDeserializer.cs b/src/ui/Logic/LanguageDeserializer.cs index ee6a6bfd3..b799f8180 100644 --- a/src/ui/Logic/LanguageDeserializer.cs +++ b/src/ui/Logic/LanguageDeserializer.cs @@ -592,6 +592,9 @@ namespace Nikse.SubtitleEdit.Logic case "AudioToText/DownloadFasterWhisperCuda": language.AudioToText.DownloadFasterWhisperCuda = reader.Value; break; + case "AudioToText/NoTextFound": + language.AudioToText.NoTextFound = reader.Value; + break; case "AssaAttachments/Title": language.AssaAttachments.Title = reader.Value; break; diff --git a/src/ui/Logic/LanguageStructure.cs b/src/ui/Logic/LanguageStructure.cs index 115e39627..117942a2a 100644 --- a/src/ui/Logic/LanguageStructure.cs +++ b/src/ui/Logic/LanguageStructure.cs @@ -219,6 +219,7 @@ public string SetCppConstMeFolder { get; set; } public string OnlyRunPostProcessing { get; set; } public string DownloadFasterWhisperCuda { get; set; } + public string NoTextFound { get; set; } } public class AssaAttachments