Delegate independent tasks to specialized agents working concurrently with isolated context.
EPUB Bilingual Translate Skill
epub-translate
A skill for creating bilingual EPUB books by adding translated text alongside the original content while preserving the original formatting and structure.
SKILL.md
Full skill instructions
EPUB Bilingual Translate Skill
Overview
This skill creates bilingual EPUB files by adding translated text alongside the original content while preserving the original formatting and structure. It follows a 4-step workflow: extract, translate, update metadata, and reassemble.
Functionality
- Extracts content from EPUB archives
- Creates bilingual text content in HTML/XHTML files by adding translations alongside original text
- Updates metadata to reflect the bilingual nature of the content
- Reassembles bilingual content into a valid EPUB archive
- Preserves original formatting, structure, and non-text content
- Unzips and parses EPUB files to identify navigation and content files
- Supports multiple target languages for bilingual output
Workflow
- Extract: Unzip the EPUB file to access its contents (HTML files, metadata, etc.)
- Translate: Identify text content in HTML/XHTML files and add translations alongside original text
- Update Metadata: Modify language settings in content.opf and other relevant files to reflect bilingual content
- Reassemble: Zip the bilingual files back into a valid EPUB archive
Implementation Details
- Reads EPUB as a zip archive (mimetype, META-INF/, EPUB/ folder structure)
- Parses HTML/XHTML files to extract translatable text while preserving tags
- Updates DC metadata language field in content.opf to indicate bilingual content
- Maintains the original file structure and properties during reassembly
- Validates the final EPUB file to ensure it's a properly formatted archive
- Uses
unzip -dcommand to extract the EPUB file to a temporary directory - Opens each file in the extracted EPUB folder to examine its content
- Adds translated text alongside the original text in each file
- Preserves the original text while adding translations
- Compresses the bilingual files back into an EPUB file
Usage
- Extract the source EPUB using
unzip - Add translated text alongside original content in HTML files while keeping the markup intact
- Update language metadata in content.opf to indicate bilingual content
- Reassemble using
zipcommand with proper options to maintain EPUB format - Verify the result with
unzip -tto ensure integrity
Usage Examples
Create a bilingual English-Chinese book about mybook.epub, and save it to mybook_bilingual.epub.
Key Considerations
- EPUB files are essentially ZIP archives with a specific structure
- The mimetype file must be the first file in the archive and stored without compression
- Language attributes in HTML files and metadata should reflect the bilingual nature
- All original file paths and structures must be preserved during reassembly
- Original text content must be preserved alongside the new translations
- No automated scripts should be created for translation; instead, create a TODO list of files that need translation
- Directly read file content and perform modifications on the files rather than using automated processes
Bilingual Formatting Standards
To ensure optimal reading experience in bilingual EPUB files:
- Use paragraph-by-paragraph comparison format, with translated text immediately following the corresponding original paragraph
- Maintain consistent formatting for both languages throughout the document
- Preserve the original document structure while integrating translated content
- Use appropriate language tags (lang attributes) for both original and translated text
- Clearly separate original and translated content with visual indicators (e.g., different text colors, spacing, or containers)
- Ensure proper text direction and typography for both languages
- Maintain consistent font sizes and styles that work well for both languages
- Follow a structured approach: original paragraph, then translated paragraph, maintaining the logical flow of content
More Other skills
brand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.
internal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).
Fundamental design principles for writing maintainable, testable Python code.
responsive-design
Modern responsive layouts using container queries, fluid typography, CSS Grid, and mobile-first strategies.
Generate Playwright tests from scenarios using interactive browser exploration and validation.
Automated website exploration and test case generation using Playwright.
Modern React state management with Redux Toolkit, Zustand, Jotai, and React Query for every state category.
gdpr-data-handling
GDPR-compliant data handling with consent management, data subject rights, and privacy controls.
Python error handling patterns including input validation, exception hierarchies, and partial failure handling. Use when implementing validation logic, designing exception strategies, handling batch processing failures, or building robust APIs.
refactor-plan
Detailed multi-file refactor planning with safety checks and rollback guidance.
