Skip to content

fix(i18n): help text always shown in English (bundle load order) - #190

Open
MCForgeTitle123 wants to merge 1 commit into
EndlessPixel-Studio:masterfrom
MCForgeTitle123:fix/i18n-load-order
Open

MCForgeTitle123 wants to merge 1 commit into
EndlessPixel-Studio:masterfrom
MCForgeTitle123:fix/i18n-load-order

Conversation

@MCForgeTitle123

Copy link
Copy Markdown
Contributor

Bug

CommandHelpLocalizer assembled the message bundles in the wrong order: it loaded the locale-specific bundle, then the language bundle, then the base (message.properties, English) last. Since Properties.load overwrites existing keys, all 289 translated keys were replaced by their English defaults — help text was always rendered in English no matter the configured language.

Fix

Load from least to most specific: base → language → locale-specific, so translations win and the base is only a fallback.

Verification

  • Added CommandHelpLocalizerTest (5 cases): Chinese/Japanese translations override base, unsupported locale falls back to English, unknown key returns itself, isKey works.
  • :fakeplayer-core:test + :fakeplayer-core:spotlessCheck green.

CommandHelpLocalizer loaded message.properties (base, English) LAST, and
Properties.load overwrites earlier keys. Every one of the 289 translated keys
was therefore overwritten by its English default: help text was always shown
in English regardless of the configured language.

Load base -> language -> locale-specific so the most specific bundle wins.
@github-actions github-actions Bot added the core 核心模块 fakeplayer-core label Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core 核心模块 fakeplayer-core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant