Sync Chinese translation repository with upstream rust-lang/nomicon...
Synchronize nomicon-zh-Hans (Chinese translation) with upstream rust-lang/nomicon repository.
Extract the commit hash from src/intro.md:
目前翻译基于 commit:<commit_hash>,基于时间:<date>。
Use regex pattern: 目前翻译基于 commit:([a-f0-9]+),基于时间:(\d{4}/\d{2}/\d{2})。
Get the latest commit from upstream:
gh api repos/rust-lang/nomicon/commits/HEAD --jq '.sha'
Compare with the extracted commit hash. If identical, report "Already up to date" and exit.
List files changed between the two commits:
gh api "repos/rust-lang/nomicon/compare/<base_commit>...<latest_commit>" --jq '.files[] | select(.filename | startswith("src/")) | {filename, status, patch}'
For each changed file in src/:
Translation guidelines:
Update the commit and date line in src/intro.md:
目前翻译基于 commit:<new_commit>,基于时间:<current_date>。
Date format: YYYY/MM/DD
Provide a summary including:
## Sync Summary
**Upstream sync completed**
- Previous: 5b3a9d084cbc64e54da87e3eec7c7faae0e48ba9 (2026/01/02)
- Current: abc123def456... (2026/01/29)
### Changed Files (3)
| File | Status | Description |
|------|--------|-------------|
| src/intro.md | modified | Updated warning text |
| src/new-chapter.md | added | New chapter on XYZ |
| src/old-file.md | deleted | Removed deprecated content |
### Next Steps
1. Review the translated changes
2. Run `mdbook build` to verify
3. Commit with message: "sync: update to upstream commit abc123"