Skip to content

feat(i18n): P0 — migrate all in-game strings to Component.translatable() - #159

Merged
TheMeinerLP merged 1 commit into
mainfrom
feat/i18n-p0
Apr 25, 2026
Merged

feat(i18n): P0 — migrate all in-game strings to Component.translatable()#159
TheMeinerLP merged 1 commit into
mainfrom
feat/i18n-p0

Conversation

@TheMeinerLP

Copy link
Copy Markdown
Contributor

Summary

  • Live bug fixed: elytrarace_en_US.properties used {0} (MessageFormat) placeholders that PluginTranslationRegistry cannot resolve — players saw raw {0} text instead of values
  • Minestom rendering fixed: MinestomAdventure.AUTOMATIC_COMPONENT_TRANSLATION = true was missing — Component.translatable() was sent as raw keys to clients
  • Async loading fixed: Paper plugins now call .join() on loadLanguage() so translations are ready before player commands run
  • All player-visible strings in server, setup plugin, and game plugin migrated from Component.text("...") to Component.translatable("key", ...)
  • GameHud.java / GameHudManager.java deleted — HudComponent (ECS) is the authoritative HUD class
  • LanguageServiceImpl now scans lang/ folder dynamically instead of hardcoding en-US
  • 70+ new translation keys added across all three modules
  • Key-coverage tests added: TranslationKeysCoverageTest, SetupTranslationKeysTest, LanguageServiceImplTest
  • How-to guide added: docs/guides/how-to-add-a-translation.md

Affected modules

Module Changes
server Properties fixed, 12 new keys, HudComponent/MinestomEndPhase/DevStartCommand/VoyagerServer migrated
plugins/setup 70 new keys, 10 Java files migrated
plugins/game 4 new keys, 3 Java files migrated
shared/common LanguageServiceImpl multi-locale discovery

Deferred (P1)

HelpCommand (~30 admin-only strings) — no player impact, out of scope for this PR.

Test plan

  • ./gradlew :shared:common:testLanguageServiceImplTest (7 tests)
  • ./gradlew :server:testTranslationKeysCoverageTest (3×17 parameterized)
  • ./gradlew :plugins:setup:testSetupTranslationKeysTest (3×196 parameterized)
  • Start server in-game: lobby countdown shows formatted time, not {0}
  • Join game: phase.lobby.player.join renders with player name and count
  • Ring passthrough: HUD actionbar shows speed and points
  • End screen: race results render correctly

🤖 Generated with Claude Code

Fixes a live rendering bug where the server module used MessageFormat {0}
placeholders that PluginTranslationRegistry cannot resolve, causing raw
placeholder text in-game instead of formatted messages.

Changes:
- Fix elytrarace_en_US.properties: replace all {0}/{1}/{2} with <arg:N>
  MiniMessage syntax; add 12 new keys (hud.*, end.*, dev.*)
- Set MinestomAdventure.AUTOMATIC_COMPONENT_TRANSLATION = true so Minestom
  renders Component.translatable() against GlobalTranslator before sending
  packets to clients
- Add .join() to LanguageService initialization in Paper plugins so
  translations are registered before any player command runs
- Delete GameHud.java / GameHudManager.java (duplicate of HudComponent ECS)
- Migrate server: HudComponent, MinestomEndPhase, DevStartCommand,
  VoyagerServer
- Add 70 new translation keys to setup plugin elytrarace.properties:
  testfly.results.*, gui.portal.*, gui.cup.*, gui.cup.editor.*,
  portal.label.name, wizard.*, map.status.*, spline.*, validation.*
- Migrate setup plugin: TestflyManager, PortalManagerGui, CupListGui,
  CupEditorGui, CupGuiListener, PortalLabelManager, MapStatusCommand,
  SplineConfigCommand, ValidationIssue, WizardManager, ElytraRace
- Add 4 keys to game plugin: game.motd.cup, game.motd.ingame,
  game.init.test_cup, portal.display.label
- Migrate game plugin: DefaultListener, SimpleElytraRace, GamePortalDTO,
  ElytraRace
- Replace hardcoded languages.add("en-US") in LanguageServiceImpl with
  dynamic folder scan (discoverLanguagesFromFolder)
- Add key-coverage tests: TranslationKeysCoverageTest (server),
  SetupTranslationKeysTest (setup), LanguageServiceImplTest (shared/common)
- Add docs/guides/how-to-add-a-translation.md
- Update CLAUDE.md: add <arg:N> vs {N} convention note
@TheMeinerLP
TheMeinerLP merged commit ea04435 into main Apr 25, 2026
7 checks passed
@TheMeinerLP
TheMeinerLP deleted the feat/i18n-p0 branch April 25, 2026 09:44
voyager-release-bot Bot pushed a commit that referenced this pull request Apr 25, 2026
# [1.4.0](v1.3.0...v1.4.0) (2026-04-25)

### Features

* **i18n:** P0 — migrate all in-game strings to Component.translatable() ([#159](#159)) ([ea04435](ea04435))
@voyager-release-bot

Copy link
Copy Markdown

🎉 This PR is included in version 1.4.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant