docs: complete documentation overhaul with v3.1.0 release notes and zh-CN translations
Documentation restructure: - New docs/getting-started/ guide (4 files: install, quick-start, first-skill, next-steps) - New docs/user-guide/ section (6 files: core concepts through troubleshooting) - New docs/reference/ section (CLI_REFERENCE, CONFIG_FORMAT, ENVIRONMENT_VARIABLES, MCP_REFERENCE) - New docs/advanced/ section (custom-workflows, mcp-server, multi-source) - New docs/ARCHITECTURE.md - system architecture overview - Archived legacy files (QUICKSTART.md, QUICK_REFERENCE.md, docs/guides/USAGE.md) to docs/archive/legacy/ Chinese (zh-CN) translations: - Full zh-CN mirror of all user-facing docs (getting-started, user-guide, reference, advanced) - GitHub Actions workflow for translation sync (.github/workflows/translate-docs.yml) - Translation sync checker script (scripts/check_translation_sync.sh) - Translation helper script (scripts/translate_doc.py) Content updates: - CHANGELOG.md: [Unreleased] → [3.1.0] - 2026-02-22 - README.md: updated with new doc structure links - AGENTS.md: updated agent documentation - docs/features/UNIFIED_SCRAPING.md: updated for unified scraper workflow JSON config Analysis/planning artifacts (kept for reference): - DOCUMENTATION_OVERHAUL_PLAN.md, DOCUMENTATION_OVERHAUL_SUMMARY.md - FEATURE_GAP_ANALYSIS.md, IMPLEMENTATION_GAPS_ANALYSIS.md, CREATE_COMMAND_COVERAGE_ANALYSIS.md - CHINESE_TRANSLATION_IMPLEMENTATION_SUMMARY.md, ISSUE_260_UPDATE.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
143
.github/workflows/translate-docs.yml
vendored
Normal file
143
.github/workflows/translate-docs.yml
vendored
Normal file
@@ -0,0 +1,143 @@
|
||||
name: Translate Documentation to Chinese
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- development
|
||||
paths:
|
||||
- 'docs/**/*.md'
|
||||
- '!docs/zh-CN/**'
|
||||
- '!docs/archive/**'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
files:
|
||||
description: 'Specific files to translate (comma-separated, or "all")'
|
||||
required: false
|
||||
default: 'changed'
|
||||
|
||||
jobs:
|
||||
detect-changes:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
changed-files: ${{ steps.detect.outputs.files }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Detect changed files
|
||||
id: detect
|
||||
run: |
|
||||
if [ "${{ github.event.inputs.files }}" = "all" ]; then
|
||||
# Translate all docs
|
||||
FILES=$(find docs -name "*.md" -not -path "docs/zh-CN/*" -not -path "docs/archive/*" | tr '\n' ',')
|
||||
elif [ "${{ github.event.inputs.files }}" != "" ] && [ "${{ github.event.inputs.files }}" != "changed" ]; then
|
||||
# Use provided files
|
||||
FILES="${{ github.event.inputs.files }}"
|
||||
else
|
||||
# Detect changed files
|
||||
FILES=$(git diff --name-only HEAD~1 HEAD | grep "^docs/" | grep -v "^docs/zh-CN/" | grep -v "^docs/archive/" | grep "\.md$" | tr '\n' ',')
|
||||
fi
|
||||
|
||||
# Remove trailing comma
|
||||
FILES=$(echo "$FILES" | sed 's/,$//')
|
||||
|
||||
echo "files=$FILES" >> $GITHUB_OUTPUT
|
||||
echo "Detected files: $FILES"
|
||||
|
||||
translate:
|
||||
runs-on: ubuntu-latest
|
||||
needs: detect-changes
|
||||
if: needs.detect-changes.outputs.changed-files != ''
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install anthropic
|
||||
|
||||
- name: Translate documents
|
||||
env:
|
||||
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
run: |
|
||||
IFS=',' read -ra FILES <<< "${{ needs.detect-changes.outputs.changed-files }}"
|
||||
for file in "${FILES[@]}"; do
|
||||
if [ -f "$file" ]; then
|
||||
echo "Translating: $file"
|
||||
python scripts/translate_doc.py "$file" --target-lang zh-CN || echo "Failed: $file"
|
||||
fi
|
||||
done
|
||||
|
||||
- name: Check for changes
|
||||
id: git-check
|
||||
run: |
|
||||
git add docs/zh-CN/
|
||||
if git diff --cached --quiet; then
|
||||
echo "changed=false" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "changed=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Create Pull Request
|
||||
if: steps.git-check.outputs.changed == 'true'
|
||||
uses: peter-evans/create-pull-request@v6
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
commit-message: "[Auto] Chinese translation update"
|
||||
title: "🌐 [Auto] Chinese Documentation Translation Update"
|
||||
body: |
|
||||
## 🇨🇳 中文文档翻译更新 / Chinese Documentation Translation Update
|
||||
|
||||
This PR contains automated translations of updated documentation.
|
||||
|
||||
### 变更内容 / Changes
|
||||
${{ needs.detect-changes.outputs.changed-files }}
|
||||
|
||||
### 审阅指南 / Review Guide
|
||||
- [ ] 技术术语准确 / Technical terms accurate
|
||||
- [ ] 链接正确指向中文版本 / Links point to Chinese versions
|
||||
- [ ] 代码示例保持原样 / Code examples preserved
|
||||
- [ ] 格式正确 / Formatting correct
|
||||
|
||||
### 如何审阅 / How to Review
|
||||
1. 查看文件列表 / Check the file list
|
||||
2. 阅读中文翻译 / Read the Chinese translation
|
||||
3. 在 PR 中提出修改建议 / Suggest changes in PR
|
||||
4. 确认后批准 / Approve when satisfied
|
||||
|
||||
### 相关 Issue
|
||||
- #260 - Chinese Translation
|
||||
|
||||
---
|
||||
|
||||
*This PR was auto-generated by GitHub Actions*
|
||||
branch: auto-translate-zh-cn-${{ github.run_number }}
|
||||
delete-branch: true
|
||||
labels: translation, zh-CN, needs-review, automated
|
||||
|
||||
- name: Update Issue #260
|
||||
if: steps.git-check.outputs.changed == 'true'
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
github.rest.issues.createComment({
|
||||
issue_number: 260,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: `🤖 **自动翻译更新 / Automated Translation Update**
|
||||
|
||||
新的中文翻译已准备就绪,需要社区审阅:
|
||||
- PR: #${{ steps.create-pr.outputs.pull-request-number }}
|
||||
- 文件: ${{ needs.detect-changes.outputs.changed-files }}
|
||||
|
||||
请志愿者帮忙审阅,谢谢!
|
||||
/ Community review needed, thanks!`
|
||||
})
|
||||
Reference in New Issue
Block a user