Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LakeishaKowalczyk committed Sep 20, 2024
1 parent 4e10ff8 commit 956bd5c
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/ui/Forms/Translate/AutoTranslate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,8 @@ private async void buttonTranslate_Click(object sender, EventArgs e)
_autoTranslator.Name == NoLanguageLeftBehindServe.StaticName ||
_singleLineMode;
//bool forceMergeMode = false; // 强制多行模式,确保最高翻译质量,后期通过 UI 设置
bool forceMergeMode = Configuration.Settings.Tools.AutoTranslateMaxRetries != 0;
//bool forceMergeMode = Configuration.Settings.Tools.AutoTranslateMaxRetries != 0;
int maxMergeErrorCount = Configuration.Settings.Tools.AutoTranslateMaxRetries;
// 调试用
MessageBox.Show("forceMergeMode: " + forceMergeMode.ToString(), "Debug Info", MessageBoxButtons.OK, MessageBoxIcon.Information);

Check failure on line 846 in src/ui/Forms/Translate/AutoTranslate.cs

View workflow job for this annotation

GitHub Actions / build

The name 'forceMergeMode' does not exist in the current context

Check failure on line 846 in src/ui/Forms/Translate/AutoTranslate.cs

View workflow job for this annotation

GitHub Actions / build

The name 'forceMergeMode' does not exist in the current context

Expand Down Expand Up @@ -903,13 +904,13 @@ private async void buttonTranslate_Click(object sender, EventArgs e)
}

// 强制多行模式下,不自动回退到单行模式
if (forceMergeMode)
{
continue;
}
//if (forceMergeMode)
//{
// continue;
//}

mergeErrorCount++;
if (mergeErrorCount > 20)
if (maxMergeErrorCount >0 && mergeErrorCount > maxMergeErrorCount)
{
forceSingleLineMode = true;
}
Expand Down Expand Up @@ -938,12 +939,12 @@ private async void buttonTranslate_Click(object sender, EventArgs e)
}

TranslatedSubtitle.Paragraphs[index].Text = Utilities.AutoBreakLine(reFormattedText);
if (!string.IsNullOrWhiteSpace(translation))
/*if (!string.IsNullOrWhiteSpace(translation))
{
linesTranslated++;
// 调试用
MessageBox.Show("Max Retry Attempts: " + translation, "Debug Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
MessageBox.Show("Max Retry Attempts: s" + translation + "s", "Debug Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
}*/

_translationProgressIndex = index;
_translationProgressDirty = true;
Expand Down

0 comments on commit 956bd5c

Please sign in to comment.