原始内容
EPUB Bilingual Translate
A skill for creating bilingual EPUB books by adding translated text alongside the original content while preserving the original formatting and structure.
Overview
This tool creates bilingual EPUB files by adding translated text alongside the original content while preserving formatting and structure. It follows a simple 4-step process: extract, translate, update metadata, and reassemble.
Features
- Extracts content from EPUB archives
- Adds translated text alongside original content
- Preserves original formatting and structure
- Updates metadata to reflect bilingual content
- Reassembles content into valid EPUB format
Workflow
- Extract: Unzip the EPUB file to access HTML files, metadata, etc.
- Translate: Add translations alongside original text in HTML files
- Update Metadata: Modify language settings to reflect bilingual content
- Reassemble: Combine files back into a valid EPUB archive
Usage
- Extract source EPUB using
unzip - Add translated text alongside original content in HTML files
- Update language metadata in content.opf to indicate bilingual content
- Reassemble using
zipcommand with proper options - Verify the result with
unzip -t
Example
Create a bilingual English-Chinese book from mybook.epub as mybook_bilingual.epub.
Key Considerations
- EPUB files are ZIP archives with a specific structure
- Original text must be preserved alongside translations
- Language attributes should reflect the bilingual nature
- Use paragraph-by-paragraph format: original paragraph followed by translation
Installation
No special installation needed. Uses standard tools like unzip and zip available on most systems.