Skip to content

Move keyword ability text to localization keys#9843

Open
MostCromulent wants to merge 7 commits intoCard-Forge:masterfrom
MostCromulent:keywordlocale
Open

Move keyword ability text to localization keys#9843
MostCromulent wants to merge 7 commits intoCard-Forge:masterfrom
MostCromulent:keywordlocale

Conversation

@MostCromulent
Copy link
Copy Markdown
Contributor

@MostCromulent MostCromulent commented Feb 20, 2026

Summary

Per discussion with @Jetz72 on #9806: Moves keyword ability display names and reminder text from hardcoded Java strings in Keyword.java to en-US.properties localization keys. Follows the same pattern already used by KeywordAction in that PR.

  • 199 display name entries (lblKwAbility*) and 199 reminder text entries (lblKwAbility*Reminder)
  • No wording changes — exact same text, just externalized
  • getDisplayName() and getReminderText() both go through Localizer
  • The English displayName field is retained because smartValueOf() uses it to parse keyword names from card scripts — it's not used for display

🤖 Generated with Claude Code

MostCromulent and others added 4 commits February 21, 2026 09:17
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>
MostCromulent and others added 2 commits April 6, 2026 12:08
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
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 == '_') {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?

@Override
public String toString() {
return displayName;
return getDisplayName();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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>
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