For the Plot

You came for the porn. We translated the plot.
A complete, battle-tested fan-translation workflow for Ren'Py visual novels, packaged as a Claude Code plugin — but written so any AI assistant can follow it end to end:
decompile → extract strings → build a game profile → translate → QA → build patch → deploy
The pipeline was proven on a full Thai translation of Eternum (released; about 45,000 source strings and 307 speaker records, with per-pair Thai pronouns), and then generalized for any game and any target language.
What you get
renpy-translation skill — the whole workflow: decompiling .rpa/.rpyc, extracting dialog, setting up per-character speech registers, translating with full Ren'Py tag safety, running QA, and building a drop-in game/<language>_patch/ patch. Claude Code loads it automatically; every other tool reads the same procedure from PLAYBOOK.md.
- Pipeline scripts (cross-platform Python 3.8+, stdlib-only, tested in CI):
init_project.py — scaffolds the project folder beside the game: wired-up profile, style-guide skeleton, QA rules, a .gitignore that keeps game text out of version control, and TRANSLATION.md — the project's own always-loaded instruction file, with CLAUDE.md/AGENTS.md/GEMINI.md stubs pointing at it
extract_strings.py — pulls dialog, menu choices, on-screen text, and (with --screens) GUI/_() strings out of .rpy files, tagging each with the scene label it came from
translate_api.py — optional bulk first-pass. Providers: deepseek (preset for DeepSeek's official API — just set DEEPSEEK_API_KEY), openai-compatible (OpenAI, OpenRouter, Ollama, Azure — one factory, no SDK), Gemini, Anthropic, or headless Claude Code CLI (no API key). Resumable and token-validated; consults the Translation Memory before every call so known lines never hit the model twice. Empty replies — the classic reasoning-model failure, where thinking tokens eat the whole max_tokens budget — are diagnosed with the real cause, retried once at a raised budget, and never saved as a translation
validation.py — the shared gate that refuses to save or cache a "translation" that's just the English back again, or that contains none of the target script
translation_memory.py — a Contextual Translation Memory (TM): a durable source→translation cache that makes repeats and game-update re-runs free. As of v1.3 it stores speaker-aware variants, so when the same English line ("You.") needs a different rendering per character, the right one is retrieved deterministically from cache instead of re-translated — zero extra API cost (stats / export / import / clean)
relationships.py — addressee resolution: which character each line is spoken to, answered only from evidence it can name — a scope you declared, a name addressed in vocative position in the English, or a scene label containing exactly two speakers — and reported as unresolved, with the reason for everything else. There is deliberately no "who spoke nearby" guess: a wrong addressee yields a wrong pronoun on a line that looks perfectly fine, which is wrong silently and everywhere. Its report is also the project's audit — resolution rate per tier, which resolved pairs still have no declared register, tier disagreements, and speaker codes with no character record
orthography.py — writing conventions per target language (built in for Chinese: Simplified vs Traditional, full-width punctuation, ellipsis, spacing), stated in the translation prompt, checked by QA, and fixed mechanically where that is safe. Language-specific guidance lives in references/locales/: Thai, Chinese (Simplified and Traditional)
qa_check.py — technical checks (tags/variables/escapes/%%/missing/untranslated) plus declarative, language-specific register rules, including relationship rules that fire only on a resolved pairing
build_patch.py — generates a runtime-filter translation patch plus native translate strings blocks for GUI text (no game source modification)
- Character records —
profile.json → speakers is a real character dictionary: register, forbidden/required vocabulary, approved examples, an inner-monologue override, and per-relationship pronouns (in register-rich languages the pronoun belongs to the pair, not the person — the same protagonist uses one form with a close friend and another with a professor). Each record becomes a persona card in the translation prompt and a QA register rule, from one source — so the voice you asked for is the voice that gets checked. Every field is optional.