Skip to content

Commit 6ca2048

Browse files
committed
feat: add translation agent guide (AGENTS.md) in English
1 parent 292572b commit 6ca2048

2 files changed

Lines changed: 195 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# AGENTS.md - FreeCodeCamp Chengdu Community Wiki
2+
3+
This project is a documentation database, primarily used for translating English tech articles into Chinese.
4+
5+
## Project Structure
6+
7+
- `_drafts/Article/Translation/` - Articles pending translation
8+
- `_posts/Article/Translation/` - Completed translations
9+
- `_posts/` - Other published content
10+
11+
## Translation Workflow
12+
13+
1. Select an article from `_drafts/Article/Translation/`
14+
2. Translate in the original file (do not create new files)
15+
3. After completion, move the file to `_posts/Article/Translation/`
16+
17+
## Article Front Matter Format
18+
19+
After translation, update front matter to:
20+
21+
```yaml
22+
---
23+
title: Chinese title
24+
date: Original article date
25+
updated: Translation completion date
26+
authors:
27+
- Translator's GitHub username
28+
original: Original article URL
29+
categories:
30+
- Article
31+
- Translation
32+
toc: true
33+
---
34+
```
35+
36+
## Code Style
37+
38+
- Use Simplified Chinese
39+
- For technical terms, use format on first occurrence: `中文术语(English Term)`
40+
- Keep code blocks, commands, and variable names unchanged
41+
- Translate link text, keep URLs unchanged
42+
- Remove navigation links, author avatars, and irrelevant content from original
43+
- Preserve `<!-- more -->` marker as excerpt separator
44+
45+
## Long Article Translation Strategy
46+
47+
For articles over 300 lines, refer to `_drafts/Article/Translation/AGENTS.md` for chunked translation strategy.
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# Tech Article Translation Agent Guide
2+
3+
This directory contains English tech articles pending translation to Chinese. This document provides guidance for AI coding assistants.
4+
5+
## Translation Quality Standards
6+
7+
- **Accuracy**: Faithfully convey original meaning without omissions or distortions
8+
- **Fluency**: Output should follow natural Chinese expression patterns
9+
- **Consistency**: Maintain uniform terminology throughout the article
10+
- **Completeness**: Preserve code examples, links, and document structure
11+
12+
## Chunked Translation Strategy (For 300+ Line Articles)
13+
14+
Long articles exceed single conversation context limits. Chunked processing ensures translation quality.
15+
16+
### Step 1: Analyze Article Structure
17+
18+
1. Read the full article, identify main sections (typically `##` headings)
19+
2. Count total lines and lines per section
20+
3. Divide article into translation units at section boundaries, each 200-300 lines
21+
22+
### Step 2: Build Glossary
23+
24+
Before translating, scan the full text to extract key terms:
25+
26+
```markdown
27+
## Glossary
28+
29+
| English Term | Chinese Translation | Notes |
30+
|-------------|---------------------|-------|
31+
| Shadow DOM | 影子 DOM | Web Components term |
32+
| Custom Element | 自定义元素 | |
33+
| hydration | 水合 | React/SSR term |
34+
```
35+
36+
Use this glossary as reference to ensure consistency across the article.
37+
38+
### Step 3: Translate by Chunks
39+
40+
For each translation unit:
41+
42+
1. **Read the section's original text**
43+
2. **Translate with glossary reference**
44+
3. **Edit the original file directly**, replacing English with Chinese
45+
4. **Keep code blocks unchanged**
46+
5. Proceed to next section
47+
48+
### Step 4: Integration Check
49+
50+
After translation:
51+
52+
1. Read through entire article for coherence
53+
2. Verify terminology consistency
54+
3. Update front matter
55+
4. Move file to `_posts/Article/Translation/`
56+
57+
## Translation Unit Template
58+
59+
Each translation unit should be tracked as:
60+
61+
```
62+
=== Translation Unit [N/Total] ===
63+
Section: [Section Title]
64+
Line Range: [Start-End]
65+
Status: [Pending/In Progress/Completed]
66+
===
67+
```
68+
69+
## Content Cleanup Rules
70+
71+
Remove the following during translation:
72+
73+
- Navigation breadcrumbs (e.g., `- [Home][1] - [Docs][2]`)
74+
- Author avatars and social links
75+
- Page metadata prompts (e.g., "Stay organized with collections...")
76+
- Duplicate titles (keep one)
77+
78+
## Content to Preserve
79+
80+
- All code blocks (keep as-is)
81+
- `<!-- more -->` excerpt separator
82+
- Footnote link references (`[1]: https://...`)
83+
- Image references
84+
85+
## Translation Style Guide
86+
87+
### Terminology Handling
88+
89+
```
90+
First occurrence: 服务端渲染(Server-Side Rendering,SSR)
91+
Subsequent uses: 服务端渲染 or SSR
92+
```
93+
94+
### Punctuation
95+
96+
- Use Chinese punctuation: ,。!?:;""''
97+
- Use English punctuation for code-related content
98+
99+
### Paragraph Format
100+
101+
- Maintain original paragraph structure
102+
- Split overly long sentences for readability when appropriate
103+
104+
## Example: Translation Workflow
105+
106+
Using `declarative-shadow-dom.md` (332 lines) as example:
107+
108+
```
109+
1. Analyze structure:
110+
- Front Matter: lines 1-9
111+
- Introduction: lines 10-54 → Unit 1
112+
- Building a Declarative Shadow Root: lines 55-82 → Unit 2
113+
- Component hydration: lines 83-151 → Unit 3
114+
- Remaining sections... → Units 4-N
115+
116+
2. Build glossary:
117+
| Shadow DOM | 影子 DOM |
118+
| Declarative Shadow Root | 声明式影子根 |
119+
| Custom Element | 自定义元素 |
120+
| slot | 插槽 |
121+
122+
3. Translate unit by unit, editing file directly
123+
124+
4. Final review and move file
125+
```
126+
127+
## Common Technical Terms Reference
128+
129+
| English | Recommended Chinese |
130+
|---------|---------------------|
131+
| Shadow DOM | 影子 DOM |
132+
| Web Components | Web 组件 |
133+
| Custom Elements | 自定义元素 |
134+
| Server-Side Rendering | 服务端渲染 |
135+
| hydration | 水合/激活 |
136+
| streaming | 流式传输 |
137+
| polyfill | 垫片/polyfill |
138+
| slot | 插槽 |
139+
| encapsulation | 封装 |
140+
| DOM tree | DOM 树 |
141+
| API | API |
142+
| callback | 回调 |
143+
| async/await | async/await |
144+
| middleware | 中间件 |
145+
| container | 容器 |
146+
| orchestration | 编排 |
147+
| deployment | 部署 |
148+
| CI/CD | CI/CD |

0 commit comments

Comments
 (0)