Skip to content

feat: Translate player strings via module_string - #32

Merged
Helias merged 1 commit into
azerothcore:mainfrom
EricksOliveira:feat/module-string-translations
Nov 20, 2026
Merged

Helias merged 1 commit into
azerothcore:mainfrom
EricksOliveira:feat/module-string-translations

Conversation

@EricksOliveira

@EricksOliveira EricksOliveira commented Nov 19, 2026 •

Copy link
Copy Markdown

What and why

Closes #5

The chat messages and the gossip options of the replay NPC (98500) were hardcoded English in src/ArenaReplay.cpp. They now come from module_string / module_string_locale, so each player sees them in their client's locale. The English text is unchanged.

Decisions worth knowing

  • The strings live in a new data/sql/db-world/ArenaReplayStrings.sql, apart from ArenaReplayWorld.sql. The updater reapplies a module file whenever its hash changes, so fixing a translation won't reapply the NPC data.
  • The new file has to be imported. With the default Updates.EnableDatabases the core does it on startup. Servers that apply module SQL by hand need to import it before running this, since a missing module_string row makes the core's GetModuleString return an invalid pointer.
  • "vs" in the replay list stays as is, it reads the same in every locale. So does "Battleground": it's stored as the team name in character_arena_replays, it isn't UI text.

Translations

koKR, frFR, deDE, zhCN, zhTW, esES, esMX and ruRU are included. They weren't reviewed by native speakers, so corrections are welcome. esES and esMX are the same.

Known gaps

Testing

Not tested in-game yet.

AI-assisted: Claude Code (Claude Opus 5.5).

Summary by CodeRabbit

  • New Features
    • Arena replay notifications, menu labels, validation messages, and error responses are now available in English, Korean, French, German, Simplified and Traditional Chinese, Spanish, and Russian. This provides localized guidance across replay saving, match selection, queues, maps, and replay playback.

Move the 14 chat messages and 20 gossip options of the replay NPC
from hardcoded English text to module_string, so each player sees
them in the client locale. The English text is unchanged.

Add translations for the 8 locales of module_string_locale in a new
ArenaReplayStrings.sql, kept apart from ArenaReplayWorld.sql so a
translation fix does not reapply the NPC data.
@EricksOliveira

Copy link
Copy Markdown
Author

Self-review — feat/module-string-translations → main

Outcome 4 findings — 1 fixed, 1 deferred, 2 dismissed — no further round needed

Caveat fixes not re-reviewed: finding 3 (PR title and description with Closes #5), applied on PR creation

Caveat not tested in-game yet (author)

Reviewed fb54a66 (feat/module-string-translations vs origin/main of azerothcore/mod-arena-replay, merge-base diff — 2 files, +395 −37)

By Claude Code (desktop app, Claude Agent SDK), Claude Opus 5.5 (claude-opus-5-5) — self-review v1.2, 2026-11-19

Verification C++ codestyle linter: only the 8 findings already at the merge base (shifted +45 lines), none new; SQL linter rules: pass; SQL vs enum script: 34 ids match, English byte-identical, 272 locale rows with matching {} counts, BMP only

Review details (1 round)

Intent Resolve #5: serve the module's player-facing chat messages and NPC gossip options from module_string / module_string_locale instead of hardcoded English, keeping the English text unchanged and providing translations for the 8 supported locales.

Project rules .agents/docs/self-review-rules.md (core repo) found and applied: pinned review, regression-risk depth, upstream attribution (none mirrored), in-game testing asked

Diff 3ffb884aa293e5d87d02149b0e06b94319e1a479

Metadata 5c29fc6bac3759cd6234443104dc8ff8eca99b9f

Target is origin/main, not the upstream remote: in this module upstream points to an unrelated older fork with diverged history.

Reviewer wrote nothing into either repository (file lists compared against a pre-review baseline).

Round 1 — fb54a66, 4 findings

  1. src/ArenaReplay.cpp:61-64 and all PSendModuleSysMessage / PGetParseModuleString calls — a missing module_string row makes core ObjectMgr::GetModuleString return (std::string*)"error", so a server that skips importing ArenaReplayStrings.sql crashes on the first NPC 98500 gossip → deferred: root cause is in core and hits every module using module_string; a module-side guard would cover gossip only, not the core chat helper. Follow-up core PR to make the fallback a static std::string; the PR description states the file must be imported
  2. src/ArenaReplay.cpp (36 changed lines > 80, 5 newly > 120) and 4 SQL lines > 120 — exceed .editorconfig max_line_length = 80 → dismissed: changed lines keep the file's one-call-per-line format (42 lines > 120 before the change); wrapping only these would mix two styles in the same block
  3. Submission metadata — no Closes #5, so merging would not close the issue → fixed: PR title and description with Closes #5, applied on PR creation
  4. src/ArenaReplay.cpp:899 "vs" and :478-479 "Battleground" — remain English in the replay list → dismissed: "vs" is a universal abbreviation in every target locale; "Battleground" is persisted team-name data in character_arena_replays, not UI text, and translating it would change the stored format

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The replay module adds 34 English strings and translations in eight locales. Replay and gossip messages now retrieve text through module strings. Existing menu conditions, queries, validations, and replay flow remain unchanged.

Changes: Arena replay localization

Layer / File(s) Summary
String identifiers and localized entries
src/ArenaReplay.cpp, data/sql/db-world/ArenaReplayStrings.sql
The replay code defines module string identifiers and a session-based lookup helper. The SQL script seeds 34 English strings and translations for Korean, French, German, Simplified Chinese, Traditional Chinese, Spanish (Spain and Mexico), and Russian.
Replay and gossip message lookups
src/ArenaReplay.cpp
Replay-save notifications, gossip labels, validation and lookup feedback, favorite-match responses, queue and map failures, replay-start messages, and missing-data errors now use module strings. Existing checks and flow remain unchanged.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Feature

Suggested reviewers: laasker

Merge Risk: Minimal · up to fb54a

This change moves replay NPC chat messages and gossip options into localized module strings without changing the English text or replay flow. No concrete merge-blocking risk was found. Translations have not been reviewed by native speakers, and the SQL must be imported before the module runs if module SQL is applied manually.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "feat: Translate player strings via module_string" matches the main change. The PR moves hardcoded English chat messages and gossip options in src/ArenaReplay.cpp to module_string lookups, a…
Linked Issues check Passed Issue #5 ("Use module_string for string translations") is the only active direct link. Its body gives no detailed acceptance criteria, so the requirement is read as: translatable replay NPC strings us…
Out of Scope Changes check Passed The changes match the stated objective. The new SQL file holds only module string rows for the replay NPC. The src/ArenaReplay.cpp changes, per the summary, replace inline English text with module str…
Full details: Title check

Explanation

The title "feat: Translate player strings via module_string" matches the main change. The PR moves hardcoded English chat messages and gossip options in src/ArenaReplay.cpp to module_string lookups, and adds a SQL script with translations for eight locales. The title is specific and concise, and it names the mechanism used.

Full details: Linked Issues check

Explanation

Issue #5 ("Use module_string for string translations") is the only active direct link. Its body gives no detailed acceptance criteria, so the requirement is read as: translatable replay NPC strings use module_string and module_string_locale. The PR summary states that the 14 chat messages and 20 gossip options in src/ArenaReplay.cpp now come from module_string. The reviewed head contains data/sql/db-world/ArenaReplayStrings.sql. It defines 34 module_string rows for mod-arena-replay (IDs 1-34) and matching module_string_locale rows for koKR, frFR, deDE, zhCN, zhTW, esES, esMX and ruRU. IDs 1-14 match the chat messages and IDs 15-34 match the gossip options. The src/ArenaReplay.cpp diff could not be read because its changed blobs are missing from the checkout. The code-side claim therefore rests on the PR summary, not on direct inspection. No automated tests were reported, and the author states in-game testing has not been done. Those are not coding requirements of #5 as written.

Full details: Out of Scope Changes check

Explanation

The changes match the stated objective. The new SQL file holds only module string rows for the replay NPC. The src/ArenaReplay.cpp changes, per the summary, replace inline English text with module string lookups. The summary also lists related message paths such as save notifications, validation errors, favorite-match responses, queue and map failures, and replay-start messages. These fall within the 14 chat messages that the PR describes. The summary states that gossip conditions and replay-selection behavior are unchanged. The PR states that "vs" and "Battleground" are intentionally left as-is. No unrelated file or behavior change was identified. The src/ArenaReplay.cpp diff could not be read directly, so this verdict relies on the PR summary for that file.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8f95d420-d13c-4190-b0d6-8de92db57529
Commits

Reviewing files that changed from the base of the PR and between aa0b00e and fb54a66.

Files selected for processing: 2

  • data/sql/db-world/ArenaReplayStrings.sql
  • src/ArenaReplay.cpp

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@EricksOliveira

Copy link
Copy Markdown
Author

CC @Helias

@Helias

Helias commented Nov 19, 2026

Copy link
Copy Markdown
Member

I'll have a look

@Helias
Helias merged commit 34731db into azerothcore:main Nov 20, 2026
2 checks passed
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.

Use module_string for string translations

2 participants