docx-bilingual

将中文 DOCX 文档翻译为中英双语,保留原始格式;在每行中文下方插入灰色斜体英文译文。

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "docx-bilingual":https://skillpi.com/zh/skills/deepskill-ce10ef6305e2ba7bc84265cbecf6b96c837f46d6b6d2eb79c4eb334b9e3719d7。安装前核对上游来源和版本:https://skillhub.cn/skills/user_57982f4a/docx-bilingual。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

skillhub.cn

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

将中文 DOCX 文档翻译为中英双语,保留原始格式;在每行中文下方插入灰色斜体英文译文。

0 下载

介绍来源: third_party · user_57982f4a · 1.0.0 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
适合谁
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
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

当前收录版本

1.0.0

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值92/100

亮点

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

亮点

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

亮点

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

待提升项

  • 引用文件缺失 原报告严重程度:重大

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

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

亮点

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

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

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

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

  • 保存或修改文件

    先确认输出目录和同名文件是否会被覆盖;重要文件保留备份,优先写入新的输出目录。

    主文档提及 · 第 66 行
  • 账号、密钥或授权

    使用专用、最小权限账号,不把密钥粘贴到公开内容或命令日志;核对接收数据的服务与租户。

    主文档提及 · 第 83 行

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。