Skip to content

Localization Phase 1: combat roll output on combat.roll.* keys (1-5d) - #6312

Open
wholton wants to merge 1 commit into
l10n/phase1-combat-rollsfrom
l10n/phase1-combat-roll-text
Open

wholton wants to merge 1 commit into
l10n/phase1-combat-rollsfrom
l10n/phase1-combat-roll-text

Conversation

@wholton

@wholton wholton commented Dec 6, 2026

Copy link
Copy Markdown
Collaborator

Row 1-5d of the localization plan (docs/LOCALIZATION_PLAN.md §5.0): the combat roll output. Stacked on #6311 (1-5c); this PR targets the 1-5c branch, so the diff shows 1-5d only.

What moved (combat.roll.*, CombatMessageHelper)

  • Heading: "{actor} rolls for {subject} :", with the combat names (planet or system combat with its round, the Crown of Thalnos reroll, ANTI-FIGHTER BARRAGE, BOMBARDMENT with its target, Space Cannon Offence and Defence on a planet and at a system).
  • Unit roll lines: rolls per unit and extra rolls (ICU plurals), hits-on and always-hits (one select, with or without mods), per-die modifier groups, the hit count (plural with =0) and "(nice)". The line's markdown frame (> \Nx`` and the dice) stays in code, so the disaster-watch excerpt still finds unit lines without reading words.
  • Modifiers: "+N for all/unit", the capped "to up to N dice for/from", the extra-dice notice with its scaling, and the With modifiers: header (now carried in CombatRollResult).
  • Total line **Total hits N**, and the duplicate and missing unit notices.

Roll output follows the roller's channel language (Lang.forCorrectChannel). RollHeading.name() is always English, so the replay header stays English. Homebrew callers and the replay renderer keep English overloads (displayUnitRoll, displayHitResults, displayModifiers, withExtraDiceNotice without a language).

rollHeading was also split into small methods (the round tracker and the once-per-round agent markers are unchanged, just named).

Found on the way, not changed (not localization): CombatRollService.checkBadUnits passes the missing list to the duplicate-units notice, so duplicates are never listed. Left a TODO.

Ratchet

New class line ti4.helpers.CombatMessageHelper 0.

Visible changes

None: every English text is byte-identical.

Tests

  • CombatRollTextOracleTest keeps the old CombatMessageHelper text code as a reference and compares: unit roll lines over units, dice, modifiers, roll counts and holder labels; per-die modifier groups; about 150 modifier combinations (named or not, capped or not, scope, sign, type, scaling); totals with and without X-89; and headings for every roll type, on a planet or in space, with and without Thalnos and a BOMBARDMENT target, over two rolls so the round tracker advances the same way.
  • CombatRollPayloadRendererParityTest (replay renderer vs Discord text) still passes.
  • Full mvn verify with the Postgres tests: 3956 tests, 0 failures.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant