book-translation
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBook Translation Skill
手册翻译Skill
This skill guides translation of book content for The Interactive Book of Prompting at prompts.chat.
本Skill指导你翻译 prompts.chat 网站上《交互式提示工程手册》的内容。
Overview
概述
The book has 25 chapters across 7 parts. Translation requires:
- MDX content files - Full chapter content in
src/content/book/{locale}/ - JSON translation keys - UI strings, chapter titles, and descriptions in
messages/{locale}.json
该手册分为7个部分,共25章。翻译工作需要完成以下两项内容:
- MDX内容文件 - 完整的章节内容存放于 目录下
src/content/book/{locale}/ - JSON翻译键值 - UI文本、章节标题及描述存放于 文件中
messages/{locale}.json
Prerequisites
前提条件
Before starting, identify:
- Target locale code (e.g., ,
de,fr,es,ja,ko)zh - Check if locale exists in directory
messages/ - Check if folder exists
src/content/book/{locale}/
开始翻译前,请确认以下信息:
- 目标区域代码(例如:、
de、fr、es、ja、ko)zh - 检查 目录下是否已存在该区域代码对应的文件
messages/ - 检查 文件夹是否已存在
src/content/book/{locale}/
Step 1: Copy Turkish Folder as Base
步骤1:复制土耳其语文件夹作为基础
The Turkish () translation is complete and well-tested. Copy it as your starting point instead of translating from English:
trbash
mkdir -p src/content/book/{locale}
cp -r src/content/book/*.mdx src/content/book/{locale}/
cp src/components/book/elements/locales/en.ts src/components/book/elements/locales/{locale}.ts⚠️ IMPORTANT: After copying, you MUST register the new locale in :
src/components/book/elements/locales/index.ts- Add import:
import {locale} from "./{locale}"; - Add to object:
locales{locale}, - Add to named exports:
export { en, tr, az, {locale} };
This is faster because:
- Turkish and many languages share similar sentence structures
- All JSX/React components are already preserved correctly
- File structure is already set up
- You only need to translate the prose, not recreate the structure
土耳其语()版本的翻译已完成且经过充分测试。请复制该版本作为你的翻译起点,而非直接从英语翻译:
trbash
mkdir -p src/content/book/{locale}
cp -r src/content/book/*.mdx src/content/book/{locale}/
cp src/components/book/elements/locales/en.ts src/components/book/elements/locales/{locale}.ts⚠️ 重要提示:复制完成后,必须在 中注册新的区域代码:
src/components/book/elements/locales/index.ts- 添加导入语句:
import {locale} from "./{locale}"; - 在 对象中添加:
locales{locale}, - 在命名导出中添加:
export { en, tr, az, {locale} };
选择土耳其语作为起点的优势:
- 土耳其语与许多语言的句子结构相似
- 所有JSX/React组件已被正确保留
- 文件结构已预先搭建完成
- 你只需翻译正文内容,无需重新构建结构
Step 2: Translate MDX Content Files
步骤2:翻译MDX内容文件
Edit each copied file in to translate from Turkish to your target language.
src/content/book/{locale}/Process files one by one:
编辑 目录下复制得到的所有文件,将土耳其语内容翻译为目标语言。
src/content/book/{locale}/请按以下顺序处理文件:
Chapter List (in order)
章节列表(按顺序)
| Slug | English Title |
|---|---|
| Preface |
| History |
| Introduction |
| Understanding AI Models |
| Anatomy of an Effective Prompt |
| Core Prompting Principles |
| Role-Based Prompting |
| Structured Output |
| Chain of Thought |
| Few-Shot Learning |
| Iterative Refinement |
| JSON & YAML Prompting |
| System Prompts & Personas |
| Prompt Chaining |
| Handling Edge Cases |
| Multimodal Prompting |
| Context Engineering |
| Common Pitfalls |
| Ethics & Responsible Use |
| Prompt Optimization |
| Writing & Content |
| Programming & Development |
| Education & Learning |
| Business & Productivity |
| Creative Arts |
| Research & Analysis |
| The Future of Prompting |
| Agents & Skills |
| 路径别名 | 英文标题 |
|---|---|
| Preface |
| History |
| Introduction |
| Understanding AI Models |
| Anatomy of an Effective Prompt |
| Core Prompting Principles |
| Role-Based Prompting |
| Structured Output |
| Chain of Thought |
| Few-Shot Learning |
| Iterative Refinement |
| JSON & YAML Prompting |
| System Prompts & Personas |
| Prompt Chaining |
| Handling Edge Cases |
| Multimodal Prompting |
| Context Engineering |
| Common Pitfalls |
| Ethics & Responsible Use |
| Prompt Optimization |
| Writing & Content |
| Programming & Development |
| Education & Learning |
| Business & Productivity |
| Creative Arts |
| Research & Analysis |
| The Future of Prompting |
| Agents & Skills |
MDX Translation Guidelines
MDX翻译指南
- Preserve all JSX/React components - Keep ,
<div>,<img>, etc. unchangedclassName - Preserve code blocks - Code examples should remain in English (variable names, keywords)
- Translate prose content - Headings, paragraphs, lists
- Keep Markdown syntax - ,
##,**bold**,*italic*[links](url) - Preserve component imports - Any statements at the top
import
- 保留所有JSX/React组件 - 请勿修改 、
<div>、<img>等内容className - 保留代码块 - 代码示例应保持英文(变量名、关键字)
- 翻译正文内容 - 标题、段落、列表项
- 保留Markdown语法 - 、
##、**加粗**、*斜体*[链接](url) - 保留组件导入语句 - 文件顶部的任何 语句均需保留
import
Step 3: Translate JSON Keys
步骤3:翻译JSON键值
In , translate the section. Key areas:
messages/{locale}.json"book"在 文件中,翻译 部分的内容。重点翻译以下区域:
messages/{locale}.json"book"Book Metadata
手册元数据
json
"book": {
"title": "The Interactive Book of Prompting",
"subtitle": "An Interactive Guide to Crafting Clear and Effective Prompts",
"metaTitle": "...",
"metaDescription": "...",
...
}json
"book": {
"title": "The Interactive Book of Prompting",
"subtitle": "An Interactive Guide to Crafting Clear and Effective Prompts",
"metaTitle": "...",
"metaDescription": "...",
...
}Chapter Titles (book.chapters
)
book.chapters章节标题(book.chapters
)
book.chaptersjson
"chapters": {
"00a-preface": "Preface",
"00b-history": "History",
"00c-introduction": "Introduction",
...
}json
"chapters": {
"00a-preface": "Preface",
"00b-history": "History",
"00c-introduction": "Introduction",
...
}Chapter Descriptions (book.chapterDescriptions
)
book.chapterDescriptions章节描述(book.chapterDescriptions
)
book.chapterDescriptionsjson
"chapterDescriptions": {
"00a-preface": "A personal note from the author",
"00b-history": "The story of Awesome ChatGPT Prompts",
...
}json
"chapterDescriptions": {
"00a-preface": "A personal note from the author",
"00b-history": "The story of Awesome ChatGPT Prompts",
...
}Part Names (book.parts
)
book.parts部分名称(book.parts
)
book.partsjson
"parts": {
"introduction": "Introduction",
"foundations": "Foundations",
"techniques": "Techniques",
"advanced": "Advanced Strategies",
"bestPractices": "Best Practices",
"useCases": "Use Cases",
"conclusion": "Conclusion"
}json
"parts": {
"introduction": "Introduction",
"foundations": "Foundations",
"techniques": "Techniques",
"advanced": "Advanced Strategies",
"bestPractices": "Best Practices",
"useCases": "Use Cases",
"conclusion": "Conclusion"
}Interactive Demo Examples (book.interactive.demoExamples
)
book.interactive.demoExamples交互式演示示例(book.interactive.demoExamples
)
book.interactive.demoExamplesLocalize example text for demos (tokenizer samples, temperature examples, etc.):
json
"demoExamples": {
"tokenPrediction": {
"tokens": ["The", " capital", " of", " France", " is", " Paris", "."],
"fullText": "The capital of France is Paris."
},
"temperature": {
"prompt": "What is the capital of France?",
...
}
}本地化演示中的示例文本(分词器样本、temperature示例等):
json
"demoExamples": {
"tokenPrediction": {
"tokens": ["The", " capital", " of", " France", " is", " Paris", "."],
"fullText": "The capital of France is Paris."
},
"temperature": {
"prompt": "What is the capital of France?",
...
}
}Book Elements Locales (REQUIRED)
手册元素本地化(必填)
⚠️ DO NOT SKIP THIS STEP - The interactive demos will not work in the new language without this.
Translate the locale data file at :
src/components/book/elements/locales/{locale}.ts- Temperature examples, token predictions, embedding words
- Capabilities list, sample conversations, strategies
- Tokenizer samples, builder fields, chain types
- Frameworks (CRISPE, BREAK, RTF), exercises
- Image/video prompt options, validation demos
Then register it in :
src/components/book/elements/locales/index.tstypescript
import {locale} from "./{locale}";
const locales: Record<string, LocaleData> = {
en,
tr,
az,
{locale}, // Add your new locale here
};
export { en, tr, az, {locale} }; // Add to exports⚠️ 请勿跳过此步骤 - 若不完成此步骤,新语言版本的交互式演示将无法正常工作。
翻译 文件中的本地化数据:
src/components/book/elements/locales/{locale}.ts- Temperature示例、分词预测、嵌入词汇
- 功能列表、示例对话、策略
- 分词器样本、构建器字段、链类型
- 框架(CRISPE、BREAK、RTF)、练习
- 图片/视频提示选项、验证演示
随后在 中注册该文件:
src/components/book/elements/locales/index.tstypescript
import {locale} from "./{locale}";
const locales: Record<string, LocaleData> = {
en,
tr,
az,
{locale}, // 在此处添加你的新区域代码
};
export { en, tr, az, {locale} }; // 添加至导出列表UI Strings (book.interactive.*
, book.chapter.*
, book.search.*
)
book.interactive.*book.chapter.*book.search.*UI文本(book.interactive.*
、book.chapter.*
、book.search.*
)
book.interactive.*book.chapter.*book.search.*Translate all interactive component labels and navigation strings.
翻译所有交互式组件的标签及导航文本。
Step 4: Verify Translation
步骤4:验证翻译
-
Run the check script:bash
node scripts/check-translations.js -
Start dev server and test:bash
npm run dev -
Navigate towith the target locale to verify content loads
/book
-
运行检查脚本:bash
node scripts/check-translations.js -
启动开发服务器并进行测试:bash
npm run dev -
切换至目标区域代码,访问页面,确认内容正常加载
/book
Reference: English Translation
参考:英文版本
The English () translation is complete and serves as the base template for all new translations:
en- MDX files: — copy this files to
src/content/book/*.mdxsrc/content/book/{locale}/*.mdx - JSON keys: →
messages/en.jsonsection — use as reference for structurebook
英文()版本已完整翻译,是所有新翻译的基础模板:
en- MDX文件:— 将这些文件复制到
src/content/book/*.mdxsrc/content/book/{locale}/*.mdx - JSON键值:中的
messages/en.json部分 — 可作为结构参考"book"
Recommended Workflow
推荐工作流
- Copy to
src/content/book/*.mdxsrc/content/book/{locale}/*.mdx - Copy the section from
"book"tomessages/en.json. Translate these in multiple agentic session instead of single time (token limit may exceed at once)messages/{locale}.json - Edit each file, translating English → target language
- Keep all JSX components, code blocks, and Markdown syntax intact
- 将 复制到
src/content/book/*.mdxsrc/content/book/{locale}/*.mdx - 将 中的
messages/en.json部分复制到"book"。建议分多次完成翻译,避免单次翻译内容过多触发token限制messages/{locale}.json - 编辑每个文件,将英文内容翻译为目标语言
- 保留所有JSX组件、代码块及Markdown语法不变
Quality Guidelines
质量准则
- Consistency: Use consistent terminology throughout (e.g., always translate "prompt" the same way)
- Technical terms: Some terms like "AI", "ChatGPT", "API" may stay in English
- Cultural adaptation: Adapt examples to be relevant for the target audience where appropriate
- Natural language: Prioritize natural-sounding translations over literal ones
- 一致性:全程使用统一的术语(例如:"prompt" 需始终采用相同的译法)
- 技术术语:部分术语如 "AI"、"ChatGPT"、"API" 可保留英文
- 文化适配:如有需要,可调整示例内容以贴合目标受众的文化背景
- 自然语言:优先选择通顺自然的译法,而非直译