[GH-ISSUE #6687] [Issue]: VN party and sprite tags in Game narration get translated, breaking dialogue reverse parsing and segment alignment #3745

Closed
opened 2026-10-21 06:06:46 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @menemorofaan on GitHub (Sep 25, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6687

Originally assigned to: @SpicyMarinara on GitHub.

Summary

In Game (GM) mode, unedited assistant messages containing visual novel dialogue lines with party channel tags or sprite expressions (e.g. [Speaker] [main] [patient]: "...") send those tags verbatim to the translation service. Translators translate these internal tokens into target languages (e.g. [головний] [пацієнт]), which breaks reverse parsing and causes dialogue to collapse into preceding narration segments, shifting all subsequent segment translations.

Expected behavior

  1. Internal engine/VN channel and sprite tags ([main], [side], [patient], etc.) should be stripped before text is sent to the translator, passing only [Speaker]: "...".
  2. The dialogue parser (compactDialogueRegex) should remain resilient to multiple bracketed tags before the colon, ensuring translated dialogue lines are always recognized as dialogue and never merged into narration fallback buffers.

Actual behavior

Because getGameTranslationSource() bypassed clean segment reassembly for unedited messages (if (!hasGameSegmentOverrides) return plainSource()), raw GM markup is sent directly to the translation API.

When external translators translate the channel/sprite words:

  1. partyLineRegex rejects the line because the translated channel word no longer matches the English keywords (main, side, etc.).
  2. compactDialogueRegex rejects the line because it contains 3 bracketed tokens instead of the expected 1 or 2 before the colon.
  3. The line falls into fallbackText and is merged into the preceding narration paragraph.
  4. Total segment count decreases, causing every subsequent segment's translation to shift by one or more positions.

Steps to reproduce

  1. Start a Game session with a visual novel character where the GM outputs party dialogue with channel and sprite tags (e.g. [The Unnamed] [main] [patient]: "...").
  2. Trigger translation into a non-English language (e.g. Ukrainian).
  3. Observe that [main] and the sprite emotion are translated into the target language, the dialogue line merges into the narration block above it, and subsequent segment translations are displaced.

Environment

  • Marinara Engine version: 2.4.6 (staging)
  • Install type: source
  • OS + version: Windows 10/11 x64
  • Browser or app shell: Browser

Logs, screenshots, or video

Example of mangled output:

Narration:
The Unnamed's voice blooms in your mind once more...
Translation:
Голос Безіменного знову розквітає у вашій свідомості.
[Безім'яний] [головний] [пацієнт]: «Так. Ти помер...»

(Dialogue line was merged directly into the narration segment's translation).

Additional context

Follow-up to #6615 .

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @menemorofaan on GitHub (Sep 25, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6687 Originally assigned to: @SpicyMarinara on GitHub. ## Summary In Game (GM) mode, unedited assistant messages containing visual novel dialogue lines with party channel tags or sprite expressions (e.g. `[Speaker] [main] [patient]: "..."`) send those tags verbatim to the translation service. Translators translate these internal tokens into target languages (e.g. `[головний] [пацієнт]`), which breaks reverse parsing and causes dialogue to collapse into preceding narration segments, shifting all subsequent segment translations. ## Expected behavior 1. Internal engine/VN channel and sprite tags (`[main]`, `[side]`, `[patient]`, etc.) should be stripped before text is sent to the translator, passing only `[Speaker]: "..."`. 2. The dialogue parser (`compactDialogueRegex`) should remain resilient to multiple bracketed tags before the colon, ensuring translated dialogue lines are always recognized as dialogue and never merged into narration fallback buffers. ## Actual behavior Because `getGameTranslationSource()` bypassed clean segment reassembly for unedited messages (`if (!hasGameSegmentOverrides) return plainSource()`), raw GM markup is sent directly to the translation API. When external translators translate the channel/sprite words: 1. `partyLineRegex` rejects the line because the translated channel word no longer matches the English keywords (`main`, `side`, etc.). 2. `compactDialogueRegex` rejects the line because it contains 3 bracketed tokens instead of the expected 1 or 2 before the colon. 3. The line falls into `fallbackText` and is merged into the preceding narration paragraph. 4. Total segment count decreases, causing every subsequent segment's translation to shift by one or more positions. ## Steps to reproduce 1. Start a Game session with a visual novel character where the GM outputs party dialogue with channel and sprite tags (e.g. `[The Unnamed] [main] [patient]: "..."`). 2. Trigger translation into a non-English language (e.g. Ukrainian). 3. Observe that `[main]` and the sprite emotion are translated into the target language, the dialogue line merges into the narration block above it, and subsequent segment translations are displaced. ## Environment - Marinara Engine version: 2.4.6 (staging) - Install type: source - OS + version: Windows 10/11 x64 - Browser or app shell: Browser ## Logs, screenshots, or video Example of mangled output: ```text Narration: The Unnamed's voice blooms in your mind once more... Translation: Голос Безіменного знову розквітає у вашій свідомості. [Безім'яний] [головний] [пацієнт]: «Так. Ти помер...» ``` (Dialogue line was merged directly into the narration segment's translation). ## Additional context Follow-up to #6615 . ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 06:06:46 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Sep 26, 2026):

Resolved in #6688, now merged into staging. Verified with the focused Game translation browser regressions and the UI smoke suite; all required GitHub checks and CodeRabbit completed.

<!-- gh-comment-id:5845469185 --> @SpicyMarinara commented on GitHub (Sep 26, 2026): Resolved in #6688, now merged into staging. Verified with the focused Game translation browser regressions and the UI smoke suite; all required GitHub checks and CodeRabbit completed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#3745
No description provided.