mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-21 18:52:36 +01:00
Minor fixes
This commit is contained in:
parent
7040a121b7
commit
e4574183f7
@ -1,7 +1,6 @@
|
||||
using Nikse.SubtitleEdit.Core.Common;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using static System.Net.WebRequestMethods;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core.AudioToText
|
||||
{
|
||||
|
@ -26,7 +26,12 @@ namespace Nikse.SubtitleEdit.Core.AutoTranslate
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
_apiUrl = Configuration.Settings.Tools.AutoTranslateDeepLUrl;
|
||||
if (string.IsNullOrEmpty(Configuration.Settings.Tools.AutoTranslateDeepLXUrl))
|
||||
{
|
||||
Configuration.Settings.Tools.AutoTranslateDeepLXUrl = "http://localhost:1188";
|
||||
}
|
||||
_apiUrl = Configuration.Settings.Tools.AutoTranslateDeepLXUrl;
|
||||
|
||||
_client = new HttpClient();
|
||||
_client.BaseAddress = new Uri(_apiUrl.Trim().TrimEnd('/'));
|
||||
}
|
||||
|
@ -5394,7 +5394,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
return DialogResult.No;
|
||||
}
|
||||
|
||||
MessageBox.Show("Ups - save original does not support this format - please go to Github and create an issue!");
|
||||
MessageBox.Show("Oops - save original does not support this format - please go to Github and create an issue!");
|
||||
}
|
||||
|
||||
string allText = subAlt.ToText(format);
|
||||
|
@ -123,7 +123,6 @@ namespace Nikse.SubtitleEdit.Forms.Translate
|
||||
new GoogleTranslateV2(),
|
||||
new MicrosoftTranslator(),
|
||||
new DeepLTranslate(),
|
||||
new DeepLXTranslate(),
|
||||
new LibreTranslate(),
|
||||
new MyMemoryApi(),
|
||||
new ChatGptTranslate(),
|
||||
@ -134,6 +133,7 @@ namespace Nikse.SubtitleEdit.Forms.Translate
|
||||
new OpenRouterTranslate(),
|
||||
new GeminiTranslate(),
|
||||
new PapagoTranslate(),
|
||||
new DeepLXTranslate(),
|
||||
new NoLanguageLeftBehindServe(),
|
||||
new NoLanguageLeftBehindApi(),
|
||||
};
|
||||
@ -230,6 +230,11 @@ namespace Nikse.SubtitleEdit.Forms.Translate
|
||||
|
||||
if (engineType == typeof(DeepLXTranslate))
|
||||
{
|
||||
if (string.IsNullOrEmpty(Configuration.Settings.Tools.AutoTranslateDeepLXUrl))
|
||||
{
|
||||
Configuration.Settings.Tools.AutoTranslateDeepLXUrl = "http://localhost:1188";
|
||||
}
|
||||
|
||||
FillUrls(new List<string>
|
||||
{
|
||||
Configuration.Settings.Tools.AutoTranslateDeepLXUrl,
|
||||
@ -1065,6 +1070,19 @@ namespace Nikse.SubtitleEdit.Forms.Translate
|
||||
UiUtil.ShowHelp("#translation");
|
||||
}
|
||||
}
|
||||
else if (linesTranslate == 0 && engineType == typeof(DeepLXTranslate) && exception.Message.Contains("No connection could be made because the target machine actively refused it"))
|
||||
{
|
||||
MessageBox.Show(
|
||||
this, "You need a local API to use DeepLX. Run ths docker command: "+ Environment.NewLine +
|
||||
"docker run -itd -p 1188:1188 ghcr.io/owo-network/deeplx:latest" + Environment.NewLine +
|
||||
Environment.NewLine +
|
||||
exception.Message + Environment.NewLine +
|
||||
Environment.NewLine +
|
||||
"For more information visit: " + new DeepLXTranslate().Url,
|
||||
Text,
|
||||
MessageBoxButtons.OKCancel,
|
||||
MessageBoxIcon.Error);
|
||||
}
|
||||
else if (linesTranslate == 0 &&
|
||||
(nikseComboBoxUrl.Text.Contains("//192.", StringComparison.OrdinalIgnoreCase) ||
|
||||
nikseComboBoxUrl.Text.Contains("//127.", StringComparison.OrdinalIgnoreCase) ||
|
||||
|
@ -319,7 +319,7 @@ namespace Nikse.SubtitleEdit.Forms.Tts
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
MessageBox.Show("Ups: " + exception.Message + Environment.NewLine + exception.Message);
|
||||
MessageBox.Show("Oops: " + exception.Message + Environment.NewLine + exception.Message);
|
||||
SeLogger.Error(exception, $"{Text}: Error running engine {nikseComboBoxEngine.Text} with video {_videoFileName}");
|
||||
}
|
||||
}
|
||||
@ -2230,7 +2230,7 @@ namespace Nikse.SubtitleEdit.Forms.Tts
|
||||
var ok = GenerateParagraphAudio(sub, false, waveFileNameOnly);
|
||||
if (!ok)
|
||||
{
|
||||
MessageBox.Show(this, "Ups, voice generation failed!");
|
||||
MessageBox.Show(this, "Oops, voice generation failed!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ namespace Nikse.SubtitleEdit.Logic.Ocr.Binary
|
||||
{
|
||||
if (bob.ExpandCount > 0)
|
||||
{
|
||||
System.Windows.Forms.MessageBox.Show("Ups, expand image in CompareImages!");
|
||||
System.Windows.Forms.MessageBox.Show("Oops, expand image in CompareImages!");
|
||||
}
|
||||
|
||||
bob.Save(gz);
|
||||
@ -50,7 +50,7 @@ namespace Nikse.SubtitleEdit.Logic.Ocr.Binary
|
||||
{
|
||||
if (bob.ExpandCount == 0)
|
||||
{
|
||||
System.Windows.Forms.MessageBox.Show("Ups, not expanded image in CompareImagesExpanded!");
|
||||
System.Windows.Forms.MessageBox.Show("Oops, not expanded image in CompareImagesExpanded!");
|
||||
}
|
||||
|
||||
bob.Save(gz);
|
||||
|
Loading…
Reference in New Issue
Block a user