How binbingwu/multi-agent-game-localizer works
Hanhua is a project-based game-localization CLI: it extracts engine-specific text, builds linguistic context, translates batches locally, applies rule-based QA and retries, then builds and optionally installs a validated patch. The README documents human review/import-export and smoke-test capabilities. Sampled source confirms orchestration, extraction, context, translation, QA, and the System 4 plugin; build-agent internals are represented only at the documented subsystem level.
Main entry points: orchestrator.py Pipeline scheduler · translation.py Batch translation · db.py Project database · context.py Context analysis
Components 20
Project workflow
- CLI commands
hanhua/__main__.py - Pipeline scheduler
hanhua/orchestrator.py - Translation strategy
hanhua/orchestrator.py - Human review
hanhua/__main__.py - Build and install
hanhua/agents/build.py
Translation pipeline
- Context analysis
hanhua/agents/context.py - Glossary and scenes
hanhua/agents/context.py - Batch translation
hanhua/agents/translation.py - Translation QA
hanhua/agents/qa.py - Language profiles
hanhua/langs.py - Local LLM client
hanhua/llm.py
Engine integration
- Text extraction
hanhua/agents/extraction.py - System 4 plugin
hanhua/engines/system4/plugin.py - Engine registry
hanhua/engines/__init__.py
Project state
- Project database
hanhua/db.py - Project workspace
hanhua/common.py
Other components
- Localizer
- Local model server
- Game resources
- Localization patch
Connections 35
- Localizer → CLI commands: runs commands
- CLI commands → Pipeline scheduler: starts workflow
- CLI commands → Human review: imports or exports
- Human review → Project database: updates translations
- Pipeline scheduler → Project workspace: loads project
- Pipeline scheduler → Engine registry: selects plugin
- Engine registry → System 4 plugin: resolves engine
- Pipeline scheduler → Text extraction: runs extraction
- Text extraction → System 4 plugin: backs up and extracts
- System 4 plugin → Game resources: reads resources
- Text extraction → Project database: stores text units
- Pipeline scheduler → Translation strategy: creates or loads
- Pipeline scheduler → Context analysis: runs context stage
- Context analysis → Project database: reads units and scenes
- Context analysis → Glossary and scenes: builds summaries
- Context analysis → Local LLM client: requests analysis
- Context analysis → Project database: saves context
- Pipeline scheduler → Batch translation: runs translation stage
- Batch translation → Project database: loads and saves batches
- Batch translation → Glossary and scenes: uses context
- Batch translation → Translation strategy: uses instructions
- Batch translation → Local LLM client: requests translations
- Local LLM client → Local model server: sends prompts
- Local model server → Local LLM client: returns completions
- Batch translation → Translation QA: checks batches
- Translation QA → Project database: records results
- Translation QA → Batch translation: returns failed lines
- Pipeline scheduler → Translation QA: checks pending lines
- Pipeline scheduler → Build and install: runs build stage
- Build and install → Project database: loads translations
- Build and install → System 4 plugin: builds and validates
- System 4 plugin → Localization patch: writes patched files
- Build and install → Game resources: installs or restores
- Batch translation → Language profiles: uses target rules
- Translation QA → Language profiles: uses QA profiles