Skip to content

Move hardcoded Adventure Mode strings to language files - #11619

Open
churrufli wants to merge 10 commits into
Card-Forge:masterfrom
churrufli:adventure-mode-string-localization
Open

Move hardcoded Adventure Mode strings to language files#11619
churrufli wants to merge 10 commits into
Card-Forge:masterfrom
churrufli:adventure-mode-string-localization

Conversation

@churrufli

Copy link
Copy Markdown
Contributor

Some UI strings were still hardcoded in Java. This moves them into the .properties files, following the same pattern used elsewhere in the module.

Added all keys to en-US.properties.
Added Spanish translations to es-ES.properties.
Added the English text as placeholders to the other 8 languages.
No behavior changes apart from the new Spanish translations.

This only covers strings that was hardcoded in Java. The larger amount of narrative text in res/adventure/ is a huge separate task.

@churrufli churrufli added the Adventure For the Adventure Module label Aug 14, 2026
Comment on lines +467 to +481
modeSummary.name = Forge.getLocalizer().getMessage("lblSummary");

StringBuilder summaryText = new StringBuilder();
switch (selectedMode) {
case Standard:
summaryText.append("Mode: Standard\n\nYour starting deck is built from 2-3 Jumpstart packs of twenty cards each.\n\n");
summaryText.append(Forge.getLocalizer().getMessage("advModeStandardSummary"));
switch (selectedDifficulty.name) {
case "Easy":
summaryText.append("On your currently selected difficulty, Easy, you will receive three jumpstart packs of your chosen color.");
summaryText.append(Forge.getLocalizer().getMessage("advDiffEasyStandard"));
break;
case "Normal":
summaryText.append("On your currently selected difficulty, Normal, you will receive two jumpstart packs of your chosen color and one of an allied color.");
summaryText.append(Forge.getLocalizer().getMessage("advDiffNormalStandard"));
break;
case "Hard":
summaryText.append("On your currently selected difficulty, Hard, you will receive one jumpstart pack of your chosen color and one of an allied color.");
summaryText.append(Forge.getLocalizer().getMessage("advDiffHardStandard"));

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.

In long methods that need many localizer calls, I'd suggest calling Forge.getLocalizer() once and stashing it in a variable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Okay, I’ll take a look at it (next week, I’m on vacation right now). Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Adventure For the Adventure Module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants