Skip to content

Phases 1+2: translation pipeline, real-time MT, chat, settings UI - #2

Merged
LayBalt merged 1 commit into
masterfrom
phase-1-translation-mvp
Jul 23, 2026
Merged

LayBalt merged 1 commit into
masterfrom
phase-1-translation-mvp

Conversation

@Somikyy

@Somikyy Somikyy commented Jul 23, 2026 •

Copy link
Copy Markdown
Collaborator

Phase 1

What

Phase 1 MVP: the mod now actually translates — container-screen tooltips and menu labels are translated at render time via a dictionary → local cache pipeline.

Pipeline (pipeline/, providers/):

  • LegacyText — flattens Component trees into legacy В§-strings (Hypixel's native format) and back
  • Normalizer — numbers в†’ {0} placeholders, so "Damage: +{0}" covers every value with one dictionary entry
  • TranslationEngine — provider chain (bundled dictionary в†’ user-editable local JSON cache), per-line memoization (tooltips rebuild every frame), and an untranslated-<lang>.txt dump used to grow dictionaries from real gameplay
  • Bundled ru_ru starter dictionaries (61 entries: menus, stats, rarities) listed via _index.json

Integration (mixin/, config/, detect/):

  • One mixin on AbstractContainerScreen: tooltip lines (getTooltipFromContainerItem, @Inject at RETURN) and drawn labels (extractLabels в†’ GuiGraphicsExtractor.text, @ModifyArg). Display-only — ItemStacks and game state stay English, so other mods/search/commands are unaffected
  • JSON config at config/skyblock-translator/config.json: language, per-category toggles, onlyOnHypixel gate (turn off to test in singleplayer), reserved premium key field
  • Hypixel detection by server address (scoreboard-based SkyBlock detection comes in Phase 2)

Testing

  • Unit tests: Normalizer (placeholder extraction/restore round-trip) and legacy-string helpers — ./gradlew test green
  • Smoke test: runClient with DevAuth login, mod initialized, 61 dictionary entries loaded, world join + clean exit, no mixin errors

Reviewer notes

  • 26.2 renamed the container render methods (renderLabels в†’ extractLabels, GuiGraphics в†’ GuiGraphicsExtractor); mixin targets were verified against the 26.2 jar via javap
  • Chat/NPC dialogue translation and the free MT provider are Phase 2 (see README roadmap)

рџ¤– Generated with Claude Code


Phase 2

What

Phase 2: real-time online translation, chat/NPC dialogue translation, colored-argument preservation, and an in-game settings UI with a live string editor.

Real-time MT (remote/):

  • GoogleFreeTranslator (free gtx endpoint, zero setup — the default) and LibreTranslator (own instance + optional key)
  • RemoteQueue: single polite worker — dedup, 350ms spacing, persistent daily budget (default 2000/day), 60s back-off on errors
  • Results validate placeholder integrity (MT that mangles {0} is rejected), land in the local cache, and the render memo is flushed — tooltips are rebuilt every frame, so text switches to translated live, no reopen needed
  • Resolution order is now: user overrides в†’ bundled dictionary в†’ MT cache

Chat & dialogues (ChatComponentMixin):

  • 26.2 split chat entry points: addServerSystemMessage (NPC dialogues, quests, announcements — default ON) and addPlayerMessage (default OFF)
  • Messages with click/hover events are left untouched (flattening would drop the interaction)

Colors (Normalizer v2):

  • Numbers are captured together with their sign and В§-codes: В§7Damage: В§c+1,024 в†’ "Damage: {0}" + arg В§c+1,024, and the surrounding color is re-applied after the value — +250 stays aqua inside a gray line

Settings UI (ui/, YACL bundled via jar-in-jar, Mod Menu integration + O keybind):

  • General: master toggle, language dropdown (11 languages), Hypixel-only gate, per-category toggles
  • Online: provider dropdown, daily budget, LibreTranslate URL/key
  • String editor: the 50 most recently seen strings, editable in place; saved edits become overrides that beat both the dictionary and the MT cache

Testing

  • Unit tests extended for Normalizer v2 (colored args, sign capture, placeholder counting) — green
  • Smoke: runClient boots clean, DevAuth auto-login, both mixins apply without errors

Reviewer notes

  • Dictionary keys changed format: "Damage: +{0}" в†’ "Damage: {0}" (sign lives in the argument now, keeping its color)
  • 26.2 quirk: Minecraft no longer exposes the current screen; the keybind opens the config with a null parent (setScreenAndShow)
  • Free MT quality is what it is — that's the free tier by design; the string editor + overrides are the escape hatch, the premium LLM backend (Phase 3) is the real fix

рџ¤– Generated with Claude Code

Pipeline: Component -> legacy string (LegacyText) -> placeholder template
(Normalizer) -> provider chain (bundled dictionary -> local JSON cache),
memoized per line because tooltips rebuild every frame. Unknown templates
are dumped to untranslated-<lang>.txt to grow the dictionaries from real
gameplay.

- Mixin on AbstractContainerScreen: getTooltipFromContainerItem (item
  tooltips) and extractLabels/GuiGraphicsExtractor.text (menu titles) -
  display-only, ItemStacks stay English for other mods
- JSON config in config/skyblock-translator/ (language, category toggles,
  onlyOnHypixel gate with singleplayer override, premium key reserved)
- Hypixel detection by server address; SkyBlock scoreboard check is Phase 2
- Starter ru_ru dictionaries (menus, stats) loaded via _index.json
- JUnit tests for Normalizer and legacy-string helpers

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@LayBalt
LayBalt merged commit e6e9d81 into master Jul 23, 2026
2 checks passed
@Somikyy Somikyy changed the title Phase 1 MVP: render-level translation of container screens Phases 1+2: translation pipeline, real-time MT, chat, settings UI 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