-
Notifications
You must be signed in to change notification settings - Fork 5
feat: add translation agent guide (AGENTS.md) in English #229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dethan3
wants to merge
2
commits into
master
Choose a base branch
from
feature/translation-agent
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # AGENTS.md - FreeCodeCamp Chengdu Community Wiki | ||
|
|
||
| This project is a documentation database, primarily used for translating English tech articles into Chinese. | ||
|
|
||
| ## Project Structure | ||
|
|
||
| - `_drafts/Article/Translation/` - Articles pending translation | ||
| - `_posts/Article/Translation/` - Completed translations | ||
| - `_posts/` - Other published content | ||
|
|
||
| ## Translation Workflow | ||
|
|
||
| 1. Select an article from `_drafts/Article/Translation/` | ||
| 2. Translate in the original file (do not create new files) | ||
| 3. After completion, move the file to `_posts/Article/Translation/` | ||
|
|
||
| ## Article Front Matter Format | ||
|
|
||
| After translation, update front matter to: | ||
|
|
||
| ```yaml | ||
| --- | ||
| title: Chinese title | ||
| date: Original article date | ||
| updated: Translation completion date | ||
| authors: | ||
| - Translator's GitHub username | ||
| original: Original article URL | ||
| categories: | ||
| - Article | ||
| - Translation | ||
| toc: true | ||
| --- | ||
| ``` | ||
|
|
||
| ## Code Style | ||
|
|
||
| - Use Simplified Chinese | ||
| - For technical terms, use format on first occurrence: `中文术语(English Term)` | ||
| - Keep code blocks, commands, and variable names unchanged | ||
| - Translate link text, keep URLs unchanged | ||
| - Remove navigation links, author avatars, and irrelevant content from original | ||
| - Preserve `<!-- more -->` marker as excerpt separator | ||
|
|
||
| ## Long Article Translation Strategy | ||
|
|
||
| For articles over 300 lines, refer to `_drafts/Article/Translation/AGENTS.md` for chunked translation strategy. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,148 @@ | ||
| # Tech Article Translation Agent Guide | ||
|
|
||
| This directory contains English tech articles pending translation to Chinese. This document provides guidance for AI coding assistants. | ||
|
|
||
| ## Translation Quality Standards | ||
|
|
||
| - **Accuracy**: Faithfully convey original meaning without omissions or distortions | ||
| - **Fluency**: Output should follow natural Chinese expression patterns | ||
| - **Consistency**: Maintain uniform terminology throughout the article | ||
| - **Completeness**: Preserve code examples, links, and document structure | ||
|
|
||
| ## Chunked Translation Strategy (For 300+ Line Articles) | ||
|
|
||
| Long articles exceed single conversation context limits. Chunked processing ensures translation quality. | ||
|
|
||
| ### Step 1: Analyze Article Structure | ||
|
|
||
| 1. Read the full article, identify main sections (typically `##` headings) | ||
| 2. Count total lines and lines per section | ||
| 3. Divide article into translation units at section boundaries, each 200-300 lines | ||
|
|
||
| ### Step 2: Build Glossary | ||
|
|
||
| Before translating, scan the full text to extract key terms: | ||
|
|
||
| ```markdown | ||
| ## Glossary | ||
|
|
||
| | English Term | Chinese Translation | Notes | | ||
| |-------------|---------------------|-------| | ||
| | Shadow DOM | 影子 DOM | Web Components term | | ||
| | Custom Element | 自定义元素 | | | ||
| | hydration | 水合 | React/SSR term | | ||
| ``` | ||
|
|
||
| Use this glossary as reference to ensure consistency across the article. | ||
|
|
||
| ### Step 3: Translate by Chunks | ||
|
|
||
| For each translation unit: | ||
|
|
||
| 1. **Read the section's original text** | ||
| 2. **Translate with glossary reference** | ||
| 3. **Edit the original file directly**, replacing English with Chinese | ||
| 4. **Keep code blocks unchanged** | ||
| 5. Proceed to next section | ||
|
|
||
| ### Step 4: Integration Check | ||
|
|
||
| After translation: | ||
|
|
||
| 1. Read through entire article for coherence | ||
| 2. Verify terminology consistency | ||
| 3. Update front matter | ||
| 4. Move file to `_posts/Article/Translation/` | ||
|
|
||
| ## Translation Unit Template | ||
|
|
||
| Each translation unit should be tracked as: | ||
|
|
||
| ``` | ||
| === Translation Unit [N/Total] === | ||
| Section: [Section Title] | ||
| Line Range: [Start-End] | ||
| Status: [Pending/In Progress/Completed] | ||
| === | ||
| ``` | ||
|
|
||
| ## Content Cleanup Rules | ||
|
|
||
| Remove the following during translation: | ||
|
|
||
| - Navigation breadcrumbs (e.g., `- [Home][1] - [Docs][2]`) | ||
| - Author avatars and social links | ||
| - Page metadata prompts (e.g., "Stay organized with collections...") | ||
| - Duplicate titles (keep one) | ||
|
|
||
| ## Content to Preserve | ||
|
|
||
| - All code blocks (keep as-is) | ||
| - `<!-- more -->` excerpt separator | ||
| - Footnote link references (`[1]: https://...`) | ||
| - Image references | ||
|
|
||
| ## Translation Style Guide | ||
|
|
||
| ### Terminology Handling | ||
|
|
||
| ``` | ||
| First occurrence: 服务端渲染(Server-Side Rendering,SSR) | ||
| Subsequent uses: 服务端渲染 or SSR | ||
| ``` | ||
|
|
||
| ### Punctuation | ||
|
|
||
| - Use Chinese punctuation: ,。!?:;""'' | ||
| - Use English punctuation for code-related content | ||
|
|
||
| ### Paragraph Format | ||
|
|
||
| - Maintain original paragraph structure | ||
| - Split overly long sentences for readability when appropriate | ||
|
|
||
| ## Example: Translation Workflow | ||
|
|
||
| Using `declarative-shadow-dom.md` (332 lines) as example: | ||
|
|
||
| ``` | ||
| 1. Analyze structure: | ||
| - Front Matter: lines 1-9 | ||
| - Introduction: lines 10-54 → Unit 1 | ||
| - Building a Declarative Shadow Root: lines 55-82 → Unit 2 | ||
| - Component hydration: lines 83-151 → Unit 3 | ||
| - Remaining sections... → Units 4-N | ||
|
|
||
| 2. Build glossary: | ||
| | Shadow DOM | 影子 DOM | | ||
| | Declarative Shadow Root | 声明式影子根 | | ||
| | Custom Element | 自定义元素 | | ||
| | slot | 插槽 | | ||
|
|
||
| 3. Translate unit by unit, editing file directly | ||
|
|
||
| 4. Final review and move file | ||
| ``` | ||
|
|
||
| ## Common Technical Terms Reference | ||
|
|
||
| | English | Recommended Chinese | | ||
| |---------|---------------------| | ||
| | Shadow DOM | 影子 DOM | | ||
| | Web Components | Web 组件 | | ||
| | Custom Elements | 自定义元素 | | ||
| | Server-Side Rendering | 服务端渲染 | | ||
| | hydration | 水合/激活 | | ||
| | streaming | 流式传输 | | ||
| | polyfill | 垫片/polyfill | | ||
| | slot | 插槽 | | ||
| | encapsulation | 封装 | | ||
| | DOM tree | DOM 树 | | ||
| | API | API | | ||
| | callback | 回调 | | ||
| | async/await | async/await | | ||
| | middleware | 中间件 | | ||
| | container | 容器 | | ||
| | orchestration | 编排 | | ||
| | deployment | 部署 | | ||
| | CI/CD | CI/CD | | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add language specifications to fenced code blocks.
Three fenced code blocks are missing language identifiers. Specify the language for proper syntax highlighting and consistency with Markdown best practices.
🔎 Proposed fix for fenced code block language specifications
Also applies to: 89-92, 108-125
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
61-61: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents