Skip to content

Fix server-side chat messages ignoring client locale#137

Merged
Alexdoru merged 2 commits into
masterfrom
fix/server-chat-messages-translation
Apr 29, 2026
Merged

Fix server-side chat messages ignoring client locale#137
Alexdoru merged 2 commits into
masterfrom
fix/server-chat-messages-translation

Conversation

@Eldrinn-Elantey
Copy link
Copy Markdown

Summary

  • All server-side chat messages were built with ChatComponentText(GCCoreUtil.translate(...)), which resolves the translation key server-side — always en_US on a dedicated server.
  • Replaced with ChatComponentTranslation(key) across 16 files so the key is sent to the client and rendered in the player's own language.
  • EnumColor.RED prefix cases migrated to ChatStyle + EnumChatFormatting.
  • translateWithFormat cases migrated to ChatComponentTranslation(key, args...).
  • Concatenated translations (AstroMiner blocking block name) migrated to appendSibling(new ChatComponentTranslation(...)).
  • BlockBeamReceiver.sendIncorrectSideMessage() and ItemGrappleHook message left unchanged — both execute client-side only.

Replace ChatComponentText(GCCoreUtil.translate(...)) with
ChatComponentTranslation(...) across 16 files so that translation
keys are resolved client-side in the player's own locale instead of
always en_US on the dedicated server.

Covers: BlockTelemetry, BlockNasaWorkbench, BlockShortRangeTelepad,
BlockMachineMars, EntityAutoRocket, EntitySkeletonBoss,
EntityCreeperBoss, EntitySlimeling, GCPlayerStats, ItemBasic,
ItemFlag, ItemGrappleHook area, ItemAstroMiner, EntityAstroMiner,
PacketSimple, CommandSpaceStation(Add|Remove)Owner.
@Eldrinn-Elantey Eldrinn-Elantey requested a review from a team April 29, 2026 12:03
Copy link
Copy Markdown

@Guvante Guvante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't verify that this was all of them but all of the changes LGTM

@Alexdoru Alexdoru merged commit d92a2da into master Apr 29, 2026
1 of 2 checks passed
@Alexdoru Alexdoru deleted the fix/server-chat-messages-translation branch April 29, 2026 14:56
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.

3 participants