Book Translator banner
fredchu fredchu

Book Translator

Development community

Description

Literary EPUB → bilingual zh-TW EPUB translator (Claude Code skill) | 文學書 EPUB 雙語繁中翻譯(Claude Code skill)

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

book-translator

A Claude Code skill that turns literary EPUBs into **full-fidelity bilingual EPUBs**: original presentation preserved verbatim (CSS, fonts, images, file paths, class names, internal hrefs), Traditional Chinese (Taiwan) translation paragraphs interleaved after every English content paragraph.

Not a generic "throw text at an LLM" translator. The pipeline is split between deterministic structural preservation and LLM-driven translation, with five separate audit gates that fail closed.


Cloud GPU (Vast.ai / RunPod)

`scripts/cloud_llm.sh -- --book X.epub` rents a GPU, serves the Qwopus model with vLLM, translates through the omlx engine and destroys the instance. See SKILL.md "Cloud mode".

Why this exists

Generic AI book translators tend to do two things badly:

  1. They drop structure. Cover, title page, copyright, dedication, part dividers, acknowledgments, notes, about-the-author, promotional pages — many of these are short or contain images, so simple text-extract pipelines silently skip them. The output looks like a book but is missing front matter and back matter.
  2. They drop presentation. Original CSS files, embedded fonts, image assets, and class-driven typography get replaced by a generic stylesheet. The reading experience collapses.

`book-translator` treats structure and presentation as **deterministic contracts**, separate from translation quality. The original EPUB layout (`OEBPS/xhtml/05_Contents.xhtml`, `OEBPS/css/*`, `OEBPS/fonts/*`, `OEBPS/images/*`) is copied verbatim into the output EPUB; translation paragraphs are **inserted alongside** the source paragraphs, with the same class names so original CSS continues to apply.


Pipeline

source.epub
   │
   ▼
extract_epub.py           # OPF spine walk → manifest v2 + verbatim copy of
   │                       # css/, fonts/, images/, xhtml/ to /
   ▼
dispatch.py + glossary.py # parallel chapter translation with per-book glossary,
   │