diff --git a/CHANGELOG.md b/CHANGELOG.md index 0204aa7..476aa06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes are listed here. Versions follow [Semantic Versioning](https://semver.org/). +## [Unreleased] + +- A game whose comments go in one request shows just "Translating…": the count + ("12 of 40") is kept for long games sent in several parts. + ## [0.8.5] — 2026-10-21 - Translation with a ChatGPT subscription works: the list of models the subscription answers diff --git a/apps/desktop/src/translate.rs b/apps/desktop/src/translate.rs index 14b08f7..5bccf93 100644 --- a/apps/desktop/src/translate.rs +++ b/apps/desktop/src/translate.rs @@ -1113,6 +1113,11 @@ pub struct Job { const BATCH_CHARS: usize = 5000; const BATCH_ITEMS: usize = 40; +/// These texts go in one request (then a count "n of total" says nothing). +pub fn one_batch(texts: &[String]) -> bool { + texts.len() <= BATCH_ITEMS && texts.iter().map(|t| t.len()).sum::() <= BATCH_CHARS +} + impl Job { pub fn start( ctx: &egui::Context, diff --git a/apps/desktop/src/translate_ui.rs b/apps/desktop/src/translate_ui.rs index 8abaa5e..10c6c7f 100644 --- a/apps/desktop/src/translate_ui.rs +++ b/apps/desktop/src/translate_ui.rs @@ -1846,6 +1846,9 @@ impl GameTranslation { text(ui, trf("The service asks to wait… {s} s", &[("s", &waiting)]).into()); } else if n == 0 && local && now - self.job_started > 8.0 { text(ui, tr("The model is loading into memory — this can take up to a minute…").into()); + } else if self.plan.as_ref().is_some_and(|p| translate::one_batch(&p.texts)) { + // One request: a count would only jump from 0 to all. + text(ui, tr("Translating…").into()); } else { text(ui, trf("Translating… {n} of {total}", &[("n", &n), ("total", &total)]).into()); }