book-translation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Book 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:
  1. MDX content files - Full chapter content in
    src/content/book/{locale}/
  2. JSON translation keys - UI strings, chapter titles, and descriptions in
    messages/{locale}.json
该手册分为7个部分,共25章。翻译工作需要完成以下两项内容:
  1. MDX内容文件 - 完整的章节内容存放于
    src/content/book/{locale}/
    目录下
  2. 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
    messages/
    directory
  • Check if
    src/content/book/{locale}/
    folder exists
开始翻译前,请确认以下信息:
  • 目标区域代码(例如:
    de
    fr
    es
    ja
    ko
    zh
  • 检查
    messages/
    目录下是否已存在该区域代码对应的文件
  • 检查
    src/content/book/{locale}/
    文件夹是否已存在

Step 1: Copy Turkish Folder as Base

步骤1:复制土耳其语文件夹作为基础

The Turkish (
tr
) translation is complete and well-tested. Copy it as your starting point instead of translating from English:
bash
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
:
  1. Add import:
    import {locale} from "./{locale}";
  2. Add to
    locales
    object:
    {locale},
  3. 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
土耳其语(
tr
)版本的翻译已完成且经过充分测试。请复制该版本作为你的翻译起点,而非直接从英语翻译:
bash
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
中注册新的区域代码:
  1. 添加导入语句:
    import {locale} from "./{locale}";
  2. locales
    对象中添加:
    {locale},
  3. 在命名导出中添加:
    export { en, tr, az, {locale} };
选择土耳其语作为起点的优势:
  • 土耳其语与许多语言的句子结构相似
  • 所有JSX/React组件已被正确保留
  • 文件结构已预先搭建完成
  • 你只需翻译正文内容,无需重新构建结构

Step 2: Translate MDX Content Files

步骤2:翻译MDX内容文件

Edit each copied file in
src/content/book/{locale}/
to translate from Turkish to your target language.
Process files one by one:
编辑
src/content/book/{locale}/
目录下复制得到的所有文件,将土耳其语内容翻译为目标语言。
请按以下顺序处理文件:

Chapter List (in order)

章节列表(按顺序)

SlugEnglish Title
00a-preface
Preface
00b-history
History
00c-introduction
Introduction
01-understanding-ai-models
Understanding AI Models
02-anatomy-of-effective-prompt
Anatomy of an Effective Prompt
03-core-prompting-principles
Core Prompting Principles
04-role-based-prompting
Role-Based Prompting
05-structured-output
Structured Output
06-chain-of-thought
Chain of Thought
07-few-shot-learning
Few-Shot Learning
08-iterative-refinement
Iterative Refinement
09-json-yaml-prompting
JSON & YAML Prompting
10-system-prompts-personas
System Prompts & Personas
11-prompt-chaining
Prompt Chaining
12-handling-edge-cases
Handling Edge Cases
13-multimodal-prompting
Multimodal Prompting
14-context-engineering
Context Engineering
15-common-pitfalls
Common Pitfalls
16-ethics-responsible-use
Ethics & Responsible Use
17-prompt-optimization
Prompt Optimization
18-writing-content
Writing & Content
19-programming-development
Programming & Development
20-education-learning
Education & Learning
21-business-productivity
Business & Productivity
22-creative-arts
Creative Arts
23-research-analysis
Research & Analysis
24-future-of-prompting
The Future of Prompting
25-agents-and-skills
Agents & Skills
路径别名英文标题
00a-preface
Preface
00b-history
History
00c-introduction
Introduction
01-understanding-ai-models
Understanding AI Models
02-anatomy-of-effective-prompt
Anatomy of an Effective Prompt
03-core-prompting-principles
Core Prompting Principles
04-role-based-prompting
Role-Based Prompting
05-structured-output
Structured Output
06-chain-of-thought
Chain of Thought
07-few-shot-learning
Few-Shot Learning
08-iterative-refinement
Iterative Refinement
09-json-yaml-prompting
JSON & YAML Prompting
10-system-prompts-personas
System Prompts & Personas
11-prompt-chaining
Prompt Chaining
12-handling-edge-cases
Handling Edge Cases
13-multimodal-prompting
Multimodal Prompting
14-context-engineering
Context Engineering
15-common-pitfalls
Common Pitfalls
16-ethics-responsible-use
Ethics & Responsible Use
17-prompt-optimization
Prompt Optimization
18-writing-content
Writing & Content
19-programming-development
Programming & Development
20-education-learning
Education & Learning
21-business-productivity
Business & Productivity
22-creative-arts
Creative Arts
23-research-analysis
Research & Analysis
24-future-of-prompting
The Future of Prompting
25-agents-and-skills
Agents & Skills

MDX Translation Guidelines

MDX翻译指南

  1. Preserve all JSX/React components - Keep
    <div>
    ,
    <img>
    ,
    className
    , etc. unchanged
  2. Preserve code blocks - Code examples should remain in English (variable names, keywords)
  3. Translate prose content - Headings, paragraphs, lists
  4. Keep Markdown syntax -
    ##
    ,
    **bold**
    ,
    *italic*
    ,
    [links](url)
  5. Preserve component imports - Any
    import
    statements at the top
  1. 保留所有JSX/React组件 - 请勿修改
    <div>
    <img>
    className
    等内容
  2. 保留代码块 - 代码示例应保持英文(变量名、关键字)
  3. 翻译正文内容 - 标题、段落、列表项
  4. 保留Markdown语法 -
    ##
    **加粗**
    *斜体*
    [链接](url)
  5. 保留组件导入语句 - 文件顶部的任何
    import
    语句均需保留

Step 3: Translate JSON Keys

步骤3:翻译JSON键值

In
messages/{locale}.json
, translate the
"book"
section. Key areas:
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

json
"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

json
"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

json
"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

Localize 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.ts
:
typescript
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.ts
中注册该文件:
typescript
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.*
)

UI文本(
book.interactive.*
book.chapter.*
book.search.*

Translate all interactive component labels and navigation strings.
翻译所有交互式组件的标签及导航文本。

Step 4: Verify Translation

步骤4:验证翻译

  1. Run the check script:
    bash
    node scripts/check-translations.js
  2. Start dev server and test:
    bash
    npm run dev
  3. Navigate to
    /book
    with the target locale to verify content loads
  1. 运行检查脚本:
    bash
    node scripts/check-translations.js
  2. 启动开发服务器并进行测试:
    bash
    npm run dev
  3. 切换至目标区域代码,访问
    /book
    页面,确认内容正常加载

Reference: English Translation

参考:英文版本

The English (
en
) translation is complete and serves as the base template for all new translations:
  • MDX files:
    src/content/book/*.mdx
    — copy this files to
    src/content/book/{locale}/*.mdx
  • JSON keys:
    messages/en.json
    book
    section — use as reference for structure
英文(
en
)版本已完整翻译,是所有新翻译的基础模板
  • MDX文件:
    src/content/book/*.mdx
    — 将这些文件复制到
    src/content/book/{locale}/*.mdx
  • JSON键值:
    messages/en.json
    中的
    "book"
    部分 — 可作为结构参考

Recommended Workflow

推荐工作流

  1. Copy
    src/content/book/*.mdx
    to
    src/content/book/{locale}/*.mdx
  2. Copy the
    "book"
    section from
    messages/en.json
    to
    messages/{locale}.json
    . Translate these in multiple agentic session instead of single time (token limit may exceed at once)
  3. Edit each file, translating English → target language
  4. Keep all JSX components, code blocks, and Markdown syntax intact
  1. src/content/book/*.mdx
    复制到
    src/content/book/{locale}/*.mdx
  2. messages/en.json
    中的
    "book"
    部分复制到
    messages/{locale}.json
    。建议分多次完成翻译,避免单次翻译内容过多触发token限制
  3. 编辑每个文件,将英文内容翻译为目标语言
  4. 保留所有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" 可保留英文
  • 文化适配:如有需要,可调整示例内容以贴合目标受众的文化背景
  • 自然语言:优先选择通顺自然的译法,而非直译