Translate and build Classical Chinese EPUB e-books following strict formatting and quality guidelines
Assist with translating Classical Chinese EPUB e-books into modern Simplified Chinese and building EPUB files with proper formatting, fonts, and layout options.
This skill is designed for EPUB e-book projects containing Classical Chinese texts that need translation to modern Simplified Chinese. The typical structure includes HTML chapter files, CSS styling, custom fonts, and EPUB metadata.
When working with projects using this skill, expect:
- `Text/` - HTML chapter files (XHTML 1.1 format)
- `Styles/` - CSS stylesheets and JavaScript
- `Fonts/` - Chinese fonts (typically FSung series and Noto Serif SC)
- `Images/` - Book illustrations
- `content.opf` - EPUB package file (large file, use grep/limits when reading)
- `toc.ncx` - Navigation control file
Follow these strict guidelines when translating content:
1. **HTML Structure**: Add translation as independent paragraph `<p class="translation">` immediately after each original paragraph. Never include translation within original paragraph's `<p>` tag.
2. **Translation Placement**: Place translations paragraph-by-paragraph after each original, using orange/brown text color (defined in CSS).
3. **Font Size**: Translation text should be one size smaller than original text.
4. **Style Consistency**: Modify CSS in `OEBPS/Styles/` directory; HTML files reference these styles.
5. **Language Style**:
- Use modern Simplified Chinese (现代白话文)
- Pursue accuracy, faithfulness, and elegance (信达雅)
- Avoid mixing classical Chinese expressions
- Use proper modern Chinese conventions
6. **Simplified Chinese Verification (MANDATORY)**: Verify all translation text is Simplified Chinese using: `opencc -c t2s`
7. **Formatting**: Use proper symbols for book titles, place names, person names with consistent typography.
8. **Source Preservation**: Never modify original text, even if errors exist. Ask user if questions arise.
9. **Paragraph Structure**: Do not modify original paragraph formatting.
10. **Blockquote Removal**: Replace blockquote tags with regular paragraph (`<p>`) tags before translating.
11. **Jiazhu Exclusion**: Do not translate annotation content marked with `class="jiazhu"`.
12. **Quality Control (MANDATORY)**: After translation, perform secondary review to verify:
- Accuracy of meaning and context
- Proper rendering of specialized terms and names
- Consistency with guidelines
- No mismatched or missing content
13. **Font Subsetting (MANDATORY)**: After translating any HTML files, regenerate subset font:
```bash
cat OEBPS/Text/*.html | pyftsubset ~/.local/share/fonts/ttf/Noto/NotoSerifSC-Medium.ttf --text-file=/dev/stdin --output-file=OEBPS/Fonts/NotoSerifSC-Medium.otf
```
When translating HTML files, follow this exact sequence:
1. Read the source HTML file
2. Translate content following all guidelines above
3. **MANDATORY**: Perform secondary review to verify original-translation alignment
4. **MANDATORY**: Verify all translation text is Simplified Chinese using `opencc -c t2s`
5. Write/commit the translated HTML file
6. **MANDATORY**: Run font subsetting command immediately:
```bash
cat OEBPS/Text/*.html | pyftsubset ~/.local/share/fonts/ttf/Noto/NotoSerifSC-Medium.ttf --text-file=/dev/stdin --output-file=OEBPS/Fonts/NotoSerifSC-Medium.otf
```
7. Commit the updated font file
8. Push all changes to remote
**CRITICAL**: Quality control review, Simplified Chinese verification, and font subsetting are NOT OPTIONAL.
```bash
zip -r sikutiyao-vst.epub META-INF mimetype OEBPS
```
```bash
sed -i 's/vertical-rl/horizontal-tb/g' OEBPS/Styles/*.css
sed -i 's/page-progression-direction="rtl"/page-progression-direction="ltr"/g' OEBPS/content.opf
zip -r sikutiyao.epub META-INF mimetype OEBPS
```
```bash
unzip -t sikutiyao.epub
```
When editing content:
Projects support both reading directions:
Layout switching is handled via CSS `writing-mode` property changes during build.
Ensure these tools are installed:
```bash
sudo apt-get install -y zip
```
1. Always maintain XHTML 1.1 compliance
2. Never skip the mandatory font subsetting step after translation
3. Never skip the quality control review
4. Never skip the Simplified Chinese verification with opencc
5. Never modify original text content
6. Always preserve paragraph structure
7. Translation must use modern vernacular Chinese, not classical expressions
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/classical-chinese-epub-translation-and-build/raw