Skip to content

Commit 9471911

Browse files
committed
refactor: Simplify Claude review and translation sync workflow instructions
1 parent e7e23f8 commit 9471911

File tree

2 files changed

+30
-88
lines changed

2 files changed

+30
-88
lines changed

.github/workflows/claude-review.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,11 @@ jobs:
3636
Bash(msgfmt:*)
3737
direct_prompt: |
3838
Review the changed PO files in this pull request for translation quality.
39-
40-
Use `gh pr diff ${{ github.event.pull_request.number }}` to see what changed,
41-
then read the affected PO files and check for:
42-
43-
1. **Terminology consistency**: Cross-check against doc-translate/references/terminology.md
44-
2. **zh-CN terms**: Flag simplified Chinese terms (創建→建立, 代碼→程式碼, 信息→資訊, 模塊→模組, 默認→預設, 調用→呼叫, 返回→回傳, 函數→函式, 變量→變數, 實現→實作, 數據→資料, 線程→執行緒, 內存→記憶體, 異步→非同步, 訪問→存取, 當前→目前, 文檔→文件)
45-
3. **Punctuation**: Chinese sentences should use fullwidth punctuation (。,「」()), English/code stays halfwidth
46-
4. **Spacing**: Space between Chinese and English text (e.g., `使用 CPU`), no space between symbols and English
47-
5. **reST syntax**: Ensure :func:, :mod:, :class:, :meth:, :ref:, :term: roles are preserved correctly
48-
6. **Line length**: PO file lines should be <= 79 characters
49-
50-
Validate with `msgfmt --check` on changed files.
51-
52-
Post a concise review summarizing any issues found, grouped by category.
53-
If no issues found, post a short approval comment.
39+
Follow the review-translation and check-terminology skills for review criteria.
40+
41+
Steps:
42+
1. Run `gh pr diff ${{ github.event.pull_request.number }}` to identify changed PO files
43+
2. Read each changed file and review translated entries per the skill checklists
44+
3. Run `msgfmt --check` on each changed file to validate
45+
4. Post a concise review comment grouping issues by category
46+
5. If no issues found, post a short approval comment

.github/workflows/claude-translate-sync.yml

Lines changed: 22 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -90,76 +90,25 @@ jobs:
9090
You are working on the CPython sync PR #${{ steps.find-pr.outputs.pr_number }}
9191
on the `cron/sync/3.14` branch.
9292
93-
Your task is to translate new fuzzy and untranslated entries in PO files.
94-
95-
## Step 1: Find entries that need work
96-
97-
Use `msgattrib` to find files with fuzzy or untranslated entries:
98-
```
99-
msgattrib --fuzzy --only-fuzzy <file> to find fuzzy entries
100-
msgattrib --untranslated --only-untranslated <file> to find untranslated entries
101-
```
102-
103-
Focus on files changed in this PR first:
104-
```
105-
git diff --name-only origin/3.14...HEAD -- '*.po'
106-
```
107-
108-
## Step 2: Prioritize fuzzy entries
109-
110-
Fuzzy entries already have a base translation that needs updating.
111-
Compare the old msgid (`#|`) with the new msgid and update the translation.
112-
Remove the `#, fuzzy` flag and `#|` comments after fixing.
113-
114-
## Step 3: Translate untranslated entries
115-
116-
For entries with empty msgstr, provide new translations.
117-
118-
## Translation rules
119-
120-
Follow these rules strictly:
121-
- Use Traditional Chinese (zh-TW), NEVER simplified Chinese (zh-CN)
122-
- Fullwidth punctuation for Chinese: 。,「」()
123-
- Add space between Chinese and English text
124-
- Preserve all reST markup (:func:, :mod:, :class:, :ref:, :term: etc.)
125-
- Keep these terms in English: int, float, str, bytes, list, tuple, dict, set, iterator, generator, iterable, pickle
126-
- Use correct zh-TW terms: 建立(not 創建), 程式碼(not 代碼), 資訊(not 信息), 模組(not 模塊), 預設(not 默認), 呼叫(not 調用), 回傳(not 返回), 函式(not 函數), 變數(not 變量), 實作(not 實現), 資料(not 數據)
127-
- Line length <= 79 characters in PO files
128-
129-
## Step 4: Wrap and validate
130-
131-
After editing, run powrap on changed files:
132-
```
133-
uvx powrap <file>
134-
```
135-
136-
Validate with:
137-
```
138-
msgfmt --check <file>
139-
```
140-
141-
## Step 5: Commit and push
142-
143-
Stage changed PO files and commit:
144-
```
145-
git add <changed .po files>
146-
git commit -m "Translate fuzzy and untranslated entries from sync"
147-
git push
148-
```
149-
150-
## Step 6: Post summary
151-
152-
Post a comment on PR #${{ steps.find-pr.outputs.pr_number }} summarizing:
153-
- Number of fuzzy entries fixed
154-
- Number of new translations added
155-
- Files modified
156-
- Any entries skipped (and why)
157-
158-
Use:
159-
```
160-
gh pr comment ${{ steps.find-pr.outputs.pr_number }} --body "<summary>"
161-
```
162-
163-
If there are no fuzzy or untranslated entries to process, post a short
164-
comment saying the sync PR has no entries needing translation and skip
165-
the commit/push steps.
93+
Your task: translate fuzzy and untranslated entries in changed PO files.
94+
Follow the translate-po and fix-fuzzy skills for translation rules and fuzzy resolution.
95+
96+
Steps:
97+
1. Find changed PO files: `git diff --name-only origin/3.14...HEAD -- '*.po'`
98+
2. For each file, use `msgattrib --only-fuzzy` and `msgattrib --only-untranslated` to find entries
99+
3. Prioritize fuzzy entries first (use fix-fuzzy skill), then untranslated (use translate-po skill)
100+
4. After editing, run `uvx powrap <file>` and `msgfmt --check <file>`
101+
5. Commit and push:
102+
```
103+
git add <changed .po files>
104+
git commit -m "Translate fuzzy and untranslated entries from sync"
105+
git push
106+
```
107+
6. Post a summary comment on PR #${{ steps.find-pr.outputs.pr_number }} with:
108+
- Fuzzy entries fixed count
109+
- New translations added count
110+
- Files modified
111+
- Entries skipped (if any, with reasons)
112+
Use: `gh pr comment ${{ steps.find-pr.outputs.pr_number }} --body "<summary>"`
113+
114+
If no entries need work, post a short "nothing to translate" comment and skip commit/push.

0 commit comments

Comments
 (0)