Repository navigation
fix(i18n): help text always shown in English (bundle load order) - #190
Open
MCForgeTitle123 wants to merge 1 commit into
Open
MCForgeTitle123 wants to merge 1 commit into
MCForgeTitle123 wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
CommandHelpLocalizerassembled the message bundles in the wrong order: it loaded the locale-specific bundle, then the language bundle, then the base (message.properties, English) last. SinceProperties.loadoverwrites 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
CommandHelpLocalizerTest(5 cases): Chinese/Japanese translations override base, unsupported locale falls back to English, unknown key returns itself,isKeyworks.:fakeplayer-core:test+:fakeplayer-core:spotlessCheckgreen.