Move keyword ability text to localization keys#9843
Open
MostCromulent wants to merge 7 commits intoCard-Forge:masterfrom
Open
Move keyword ability text to localization keys#9843MostCromulent wants to merge 7 commits intoCard-Forge:masterfrom
MostCromulent wants to merge 7 commits intoCard-Forge:masterfrom
Conversation
Extract all 199 hardcoded reminder text strings from the Keyword enum into en-US.properties under lblKwAbility*Reminder keys. Keyword enum constructor no longer takes a reminder text parameter; getReminderText() reads from Localizer. KeywordInstance updated to use getter instead of direct field access. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Resolve conflicts in Keyword.java and en-US.properties, adapting master's changes to localized format: - ADAPT removed (master) - MONSTROSITY removed (master) - AFFINITY: KeywordWithType → Affinity.class (master) - LANDWALK: KeywordWithType → Landwalk.class (master) - CRAFT reminder text updated (master) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d798986 to
ba7f061
Compare
Resolve conflict in Keyword.java: add INCREMENT keyword using branch's 3-arg constructor pattern with reminder text in locale properties instead of master's inline 4-arg format. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
# Conflicts: # forge-game/src/main/java/forge/game/keyword/Keyword.java
Jetz72
reviewed
Apr 22, 2026
Comment on lines
+228
to
+232
| private static String toCamelCase(String enumName) { | ||
| StringBuilder sb = new StringBuilder(); | ||
| boolean capitalize = true; | ||
| for (char c : enumName.toCharArray()) { | ||
| if (c == '_') { |
Contributor
There was a problem hiding this comment.
If this is private, hard-coded to start capitalized, and only used to get the translation key, may as well fold in the lblKwAbility prefix and make it a dedicated getTranslationKey method?
Hanmac
reviewed
Apr 22, 2026
| @Override | ||
| public String toString() { | ||
| return displayName; | ||
| return getDisplayName(); |
Contributor
There was a problem hiding this comment.
This could be problematic
I had other enums crash on "toString" because Localizer was not defined yet
🤔
- Fold lblKwAbility prefix into renamed getTranslationKey helper (Jetz72) - Restore toString() to return English displayName so early stringification (logging, exceptions, static init) cannot NPE when Localizer isn't yet initialized; getDisplayName() still routes through Localizer for UI (Hanmac) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Per discussion with @Jetz72 on #9806: Moves keyword ability display names and reminder text from hardcoded Java strings in
Keyword.javatoen-US.propertieslocalization keys. Follows the same pattern already used byKeywordActionin that PR.lblKwAbility*) and 199 reminder text entries (lblKwAbility*Reminder)getDisplayName()andgetReminderText()both go through LocalizerdisplayNamefield is retained becausesmartValueOf()uses it to parse keyword names from card scripts — it's not used for display🤖 Generated with Claude Code