docx-bilingual

Translate Chinese DOCX documents into bilingual (Chinese + English) while preserving original formatting; insert the English translation in gray italic below each Chinese line.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "docx-bilingual" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-ce10ef6305e2ba7bc84265cbecf6b96c837f46d6b6d2eb79c4eb334b9e3719d7. Verify the upstream source and version against https://skillhub.cn/skills/user_57982f4a/docx-bilingual before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Translate Chinese DOCX documents into bilingual (Chinese + English) while preserving original formatting; insert the English translation in gray italic below each Chinese line.

0 Downloads

Introduction source: third_party · user_57982f4a · 1.0.0 Reference

SkillPi interpretation

Tasks
Translate Chinese docx to bilingual (Chinese + English), preserving original formatting. English translation inserted below each Chinese line in gray italic.
Audience
User asks to translate a Chinese `.docx` into bilingual format Requirement: keep ALL original formatting (tables, fonts, colors, layout) Output: Chinese line → English line below (gray, italic, 9pt)
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: docx-bilingual
description: Translate Chinese docx to bilingual (Chinese + English), preserving original formatting. English translation inserted below each Chinese line in gray italic.
category: productivity

DOCX Bilingual Translation

When to use

  • User asks to translate a Chinese .docx into bilingual format
  • Requirement: keep ALL original formatting (tables, fonts, colors, layout)
  • Output: Chinese line → English line below (gray, italic, 9pt)

Workflow

Step 1: Read the original file

Extract all text from paragraphs and table cells to identify what needs translation:

from docx import Document
doc = Document("path/to/file.docx")

# Paragraphs
for p in doc.paragraphs:
    print(p.text)

# Tables
for table in doc.tables:
    for row in table.rows:
        for cell in row.cells:
            print(cell.text)

Step 2: Translate

Translate every non-empty Chinese text to English. Build a dict mapping {chinese_text: english_text}. Translate ALL meaningful content — titles, instructions, field labels, table headers, notes. Do NOT skip items because "they look similar" — every line matters in official forms.

Step 3: Insert translations

For each paragraph with a translation, insert a new paragraph right after the original:

def insert_after_paragraph(para, en_text):
    new_para = doc.add_paragraph()
    run = new_para.add_run(en_text)
    run.font.size = Pt(9)
    run.font.color.rgb = RGBColor(0x66, 0x66, 0x66)
    run.italic = True
    para._element.addnext(new_para._element)

For table cells, add a new paragraph inside the existing cell:

p = cell.add_paragraph()
run = p.add_run(en_text)
run.font.size = Pt(9)
run.font.color.rgb = RGBColor(0x66, 0x66, 0x66)
run.italic = True

Step 4: Save

doc.save("path/to/output.docx")

Key rules

  • Preserve everything — do not modify the original document structure, tables, or formatting. Use from docx import Document to read, then insert new paragraphs or cell paragraphs for English lines.
  • Translation style — professional English, concise. For forms: use the format field names commonly used in English business registration / legal documents.
  • Gray italic — English text must be clearly distinguishable from original Chinese (gray #666666, italic, 9pt). Use run.font.color.rgb = RGBColor(0x66, 0x66, 0x66) and run.italic = True.
  • No line skipping — every translatable line gets a translation, including single-word field labels.
  • Numbers and URLs — keep as-is, do not translate.
  • Layout: Chinese line → English line immediately below. NOT side-by-side columns.

Web Service Deployment

For deploying as a hosted web app (FastAPI + HTML frontend + Dockerfile), see references/web-service.md. Covers LLM batch-translation API pattern, multi-format handling (txt/md/docx), Railway deployment, and simple access-token auth.

Implementation notes

  • For paragraphs: para._element.addnext(new_para._element) inserts the English paragraph right after the Chinese one.
  • For table cells: cell.add_paragraph() adds English inside the same cell.
  • Translate ALL text: headings, field labels, placeholder text, notes, instructions. Build a complete {chinese: english} dict.

Common translation conventions for Chinese business forms

Chinese English
法定代表人 Legal Representative
监事 Supervisor
注册资本 Registered Capital
经营范围 Business Scope
股东 Shareholder
出资额 Capital Contribution
身份证 ID Card / Identity Document
有限公司 Co., Ltd. / Limited Company
字号 Trade Name
核名 Name Verification
工商 Administration for Industry and Commerce (AIC)
实名制 Real-name Registration
少数民族 Ethnic Minority
户籍 Hukou / Household Registration

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value92/100

Highlights

  • 高价值场景:解决中文 docx 文档双语翻译的刚需问题
  • 明确适用场景:商务文档、法律表单、注册材料等高频使用
  • 功能闭环完整:从读取、翻译到保存输出全流程覆盖
Trigger Precision95/100

Highlights

  • 触发描述完整清晰:明确说明功能为中文 docx 转双语格式
  • When to use 章节详细列出触发条件和使用场景
  • 边界定义清晰:强调保留所有原始格式,英文插入在中文下方
Structure and Standards95/100

Highlights

  • 结构完整:Step 1-4 清晰划分工作流程
  • 示例充分:提供完整的 Python 代码实现示例
  • frontmatter 完整:包含 name、description、category 等必要字段
Execution Reliability75/100

Areas to improve

  • 引用文件缺失 Reported severity: Major

    SKILL.md 中引用了 references/web-service.md 文件,但该文件未包含在 Skill 包中

    Recommendation: 请确保所有被引用的文件都包含在 Skill 包中,或移除对缺失文件的引用

Highlights

  • 工具使用正确:python-docx 库的标准用法,参数设置准确
  • 操作流程安全:保存为新文件,不覆盖原始文档
  • 代码示例完整:提供段落和表格两种场景的具体实现
Evidence Verifiability (mean of the first four)89/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Save or modify files

    Confirm the output directory and whether existing files will be replaced. Back up important files and prefer a new output directory.

    Mentioned in main document · lines 66
  • Accounts, secrets or authorization

    Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.

    Mentioned in main document · lines 83

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.