本文档使用 AI 翻译
- 创建空分支
git switch --orphan docs- 创建
README.md
cat > README.md <<EOF
# 中文文档
本文档使用 AI 翻译
EOF- 首次提交
git add .
git commit -am init
git push origin docs- 设置上游仓库
# GitHub fork Codespaces 方式已自动设置
git remote set-url upstream https://github.com/docker/docs.git
git fetch upstream main
git checkout upstream/main -- content- 增量翻译
rm -rf docs
mv content docs
git diff docs/- 本地测试
git clone https://github.com/docker/docs.git docsite
cp -r docs_zh/* ./docsite/content
cd docsite
npm install
# 构建 0.141.0
hugo build- 安装 CLI 工具 (增量更新直接使用 AI CLI 工具直接对比)
# npm install -g npm
npm install -g @google/gemini-cli
npm install -g @qwen-code/qwen-code- 使用 UV Python 脚本翻译
curl -L fx4.cn/uv | bash
uv sync
uv run translate_docs.py- 设置环境变量
.env
API_KEY=
MODEL=
API_URL=https://openrouter.ai/api/v1/chat/completions
ROOT_DIR=./docs
EXCLUDE_DIR=
OUTPUT_MODE=new_folder- AI 翻译
- Docusaurus (已内置)
hugo build