mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7022] [MERGED] fix(game): show automatic translations of Game turns again #7431
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#7431
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7022
Author: @SpicyMarinara
Created: 10/3/2026
Status: ✅ Merged
Merged: 10/3/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/game-auto-translate-7010📝 Commits (5)
0be7d07fix: show server auto-translations of Game turns7951d53fix: hide older Game translations and bound the shared parser198bae8Merge remote-tracking branch 'origin/staging' into fix/game-auto-translate-7010a8e2b75Merge remote-tracking branch 'origin/staging' into fix/game-auto-translate-70100151b82fix(game): flatten dialogue whitespace in linear time📊 Changes
8 files changed (+582 additions, -377 deletions)
View changed files
📝
CHANGELOG.md(+2 -0)📝
e2e/game-translation-edits.e2e.ts(+60 -0)📝
packages/client/src/components/game/GameNarration.tsx(+40 -343)📝
packages/client/src/lib/dialogue-quotes.ts(+6 -28)📝
packages/server/src/services/translation.service.ts(+6 -2)📝
packages/shared/src/utils/game-narration-text.ts(+390 -0)📝
scripts/regressions/background-translation.regression.ts(+8 -3)📝
scripts/regressions/game-narration-text.regression.ts(+70 -1)📄 Description
Linked issue
Closes #7010
Why this change
Auto-Translate Responses stopped showing translations in Game mode. The translation was made and paid for, then hidden. Two changes built the "text to translate" for a Game turn in different ways:
[main]. The server wasn't updated to match.So the Game screen checks the saved source, finds that it matches neither its own rebuilt text nor the raw reply, and hides the translation. It also sees that the server owns the attempt, so it never retries. That happens on almost every real turn, because nearly all of them carry
[choices:],[music:],[bg:], dialogue or note tags. Roleplay and Conversation are not affected. The existing Game auto-translate tests only used one-line plain prose, where all three texts are identical.What changed
packages/shared/src/utils/game-narration-text.tsholds the text-only Game narration parser (moved fromGameNarration.tsx), the dialogue-quote helpers, andbuildGameTranslationSource. The server's translation service and the Game screen both use it, so they always send and compare the same text.getGameTranslationSourceAliases).[used to take up to about 39 s for 40k characters; they now take 1–80 ms. Over 600k random inputs, the output is identical to the old parser's.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Run by the agent:
pnpm checkandpnpm regression:promptpass.game-narration-text(now with timing bounds),background-translation,game-shared-parser-bounds,tts-source-persistence,roleplay-vn-tts,capability-gm-verbs,open-issuesand the assigned-issue sweeps.e2e/game-translation-edits.e2e.tspasses on desktop-chromium and mobile-chromium (11 passed, 1 desktop-only skip).pnpm build:sharedand the two translation regressions pass.Known and left alone:
[Note:openers still scale badly, about 0.6 s per 40k characters. This existed before, in the client and in the server'ssegment-edits.ts.Still to verify by hand:
Not covered here: Game choices are never translated, and Translate My Messages isn't applied in the Game input. Both behave the same as before this PR.
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)CHANGELOG updated; no user docs change.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.