Skip to content

feat: add internationalization (i18n) support and Traditional Chinese translation - #43

Open
StarsShine11904 wants to merge 1 commit into
Gaming32:mainfrom
StarsShine11904:feature/i18n-support
Open

StarsShine11904 wants to merge 1 commit into
Gaming32:mainfrom
StarsShine11904:feature/i18n-support

Conversation

@StarsShine11904

Copy link
Copy Markdown

Summary

This PR introduces a lightweight, zero-dependency localization (i18n) system to decouple hardcoded strings across UI elements, error dialogs, and console logs, allowing Mod Loading Screen to support multiple languages seamlessly.

Motivation

Previously, all status strings, window titles, and log messages were hardcoded in English. By introducing an early-stage localization parser, the mod can now adapt to the player's system language without pulling in heavy external dependencies during early bootstrap.

Changes

  • Lightweight Parser: Implemented a flat JSON translation loader using regex in ActualLoadingScreen to ensure zero third-party dependencies during early boot.
  • Locale Resolution: Automatically falls back to en_us if the user's system locale is missing or a key is untranslated.
  • String Decoupling: Replaced hardcoded UI status strings, window titles, and logger outputs with translation keys across:
    • ActualLoadingScreen.java
    • EarlyLoadingAgent.java
    • MlsTransformers.java
    • ModLoadingScreen.java
  • Language Resources: Added default en_us.json and Traditional Chinese zh_tw.json.
  • Mod Menu Support: Added Mod Menu name and description translation entries.

Testing

  • Verified English fallback works as expected.
  • Verified Traditional Chinese strings load properly under Traditional Chinese system locale.
  • Confirmed no class-loading issues occur during the early agent/bootstrap stage.

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.

1 participant