Skip to content

Extract hardcoded UI strings to resources to enable english language localization - #3

Closed
Jake-Taylor02 wants to merge 1 commit into
44-99:mainfrom
Jake-Taylor02:localization
Closed

Extract hardcoded UI strings to resources to enable english language localization#3
Jake-Taylor02 wants to merge 1 commit into
44-99:mainfrom
Jake-Taylor02:localization

Conversation

@Jake-Taylor02

Copy link
Copy Markdown

What changed

  • Created messages.properties files in resources directory to hold Chinese and English UI text respectively.
  • Modified AppResources.java to handle the new text properties.
  • Modified MainFrame.java and LoginPanel.java to use properties
  • 'en' can be passed as a CLI argument to switch the locale to english

Why

I wanted to contribute to this project but I can't read Chinese!
Extracting hard-coded UI text to properties will allow the application to be used in multiple languages.

I've only done the login panel before opening this PR in case you're not interested in the change.
Please let me know what you think @44-99 and whether you want to pursue this feature.

Screenshots or metrics

image Screenshot From 2026-07-23 02-48-23

@44-99

44-99 commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Hi Jake, thank you for the contribution and for opening this as a draft first!

Yes, I would like to pursue English localization. Making the application usable for people who cannot read Chinese is a valuable improvement.

For this first PR, please keep the scope focused on the startup and login flow. You do not need to translate the entire game in one PR, and the existing issues #1 and #2 are unrelated to this change.

I reviewed the current commit and found a few things to address before marking it ready for review:

  • remove the accidental empty messages.properties file from the repository root;
  • localize the remaining visible startup/login strings, including the game title, window title, and local-player initialization error;
  • change dialog.syntax so it contains a real newline instead of a literal \n;
  • use the existing MessageFormat helper for exception details instead of concatenating translated text, so the English error messages have correct spacing and punctuation;
  • remove the unused aisolve.stop entry from this scoped PR, or translate and use it in a later localization PR;
  • add tests for loading both bundles, matching translation keys, and packaged resource availability;
  • document the English launch argument in both README.md and README_EN.md;
  • run mvn clean verify with Java 22 or later.

Once these are complete and CI passes, please mark the PR as ready for review. Thanks again for helping make the project accessible to more users!

@44-99

44-99 commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Hi Jake, thank you again for identifying the localization gap and opening this draft. To keep the project moving, I have now completed an independent, repository-wide localization implementation on main in commit 1ff6934. It covers the login flow, difficulty selection, game controls, AI progress and results, leaderboard, save dialogs, and audio errors; it also adds system-locale selection, --lang=en / --lang=zh-CN, matching bundle-key tests, and Java 22 CI verification.

Because main now contains a broader implementation and this draft would conflict with it, I am closing this PR as superseded rather than merging the incomplete patch. Your contribution directly highlighted an important accessibility problem and helped prioritize the finished feature. Thank you for making the project more welcoming to English-speaking users. If you would like to contribute again, the public roadmap now lists several scoped follow-up areas.

@44-99 44-99 closed this Jul 23, 2026
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.

2 participants