# 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

1. **Extract**: Unzip the EPUB file to access HTML files, metadata, etc.
2. **Translate**: Add translations alongside original text in HTML files
3. **Update Metadata**: Modify language settings to reflect bilingual content
4. **Reassemble**: Combine files back into a valid EPUB archive

## Usage

1. Extract source EPUB using `unzip`
2. Add translated text alongside original content in HTML files
3. Update language metadata in content.opf to indicate bilingual content
4. Reassemble using `zip` command with proper options
5. 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.
