Phases 1+2: translation pipeline, real-time MT, chat, settings UI - #2
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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— flattensComponenttrees into legacy §-strings (Hypixel's native format) and backNormalizer— numbers →{0}placeholders, so"Damage: +{0}"covers every value with one dictionary entryTranslationEngine— provider chain (bundled dictionary → user-editable local JSON cache), per-line memoization (tooltips rebuild every frame), and anuntranslated-<lang>.txtdump used to grow dictionaries from real gameplayru_rustarter dictionaries (61 entries: menus, stats, rarities) listed via_index.jsonIntegration (
mixin/,config/,detect/):AbstractContainerScreen: tooltip lines (getTooltipFromContainerItem,@Injectat RETURN) and drawn labels (extractLabels→GuiGraphicsExtractor.text,@ModifyArg). Display-only — ItemStacks and game state stay English, so other mods/search/commands are unaffectedconfig/skyblock-translator/config.json: language, per-category toggles,onlyOnHypixelgate (turn off to test in singleplayer), reserved premium key fieldTesting
Normalizer(placeholder extraction/restore round-trip) and legacy-string helpers —./gradlew testgreenrunClientwith DevAuth login, mod initialized, 61 dictionary entries loaded, world join + clean exit, no mixin errorsReviewer notes
renderLabels→extractLabels,GuiGraphics→GuiGraphicsExtractor); mixin targets were verified against the 26.2 jar via javap🤖 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) andLibreTranslator(own instance + optional key)RemoteQueue: single polite worker — dedup, 350ms spacing, persistent daily budget (default 2000/day), 60s back-off on errors{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 neededChat & dialogues (
ChatComponentMixin):addServerSystemMessage(NPC dialogues, quests, announcements — default ON) andaddPlayerMessage(default OFF)Colors (
Normalizerv2):§7Damage: §c+1,024→"Damage: {0}"+ arg§c+1,024, and the surrounding color is re-applied after the value —+250stays aqua inside a gray lineSettings UI (
ui/, YACL bundled via jar-in-jar, Mod Menu integration +Okeybind):Testing
Reviewer notes
"Damage: +{0}"в†’"Damage: {0}"(sign lives in the argument now, keeping its color)Minecraftno longer exposes the current screen; the keybind opens the config with a null parent (setScreenAndShow)рџ¤– Generated with Claude Code