Skip to content

Commit c7a34fe

Browse files
DanWahlinCopilot
andcommitted
improve translation polish review flow
Teach the Translation Polisher to repair below-threshold grade rows, explicitly check learner-facing text for untranslated English, and manage a clean PR-body quality review block with status counts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent ba1beeb commit c7a34fe

1 file changed

Lines changed: 39 additions & 19 deletions

File tree

.github/workflows/translation-polisher.md

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,17 @@ If this workflow is triggered by `pull_request`, inspect the triggering pull req
7474

7575
Before editing, inspect the pull request's latest commit, current diff, labels, and body.
7676

77-
Stop with a no-op only if both of these are true:
77+
Stop with a no-op only if all of these are true:
7878

7979
1. The translated Markdown already satisfies the quality checklist below and no file changes are needed.
80-
2. The pull request body already contains an up-to-date `## Translation Quality Review` section with one grade row for every changed translated Markdown file.
80+
2. The pull request body already contains an up-to-date managed `## Translation Quality Review` section with one grade row for every changed translated Markdown file.
81+
3. Every existing grade in the managed review section is **A- or higher**.
8182

8283
If the latest commit appears to be from this Translation Polisher workflow but the pull request body is missing the `## Translation Quality Review` section, do not edit files. Still review and grade the changed translated Markdown files, update the pull request body, and add a concise comment if useful.
8384

84-
Do not add churn. If the translation is already good enough and the PR body already has current grades, leave it unchanged.
85+
If the pull request body already contains a managed `## Translation Quality Review` section and any row is graded **B+ or lower**, treat those files as required repair targets. Review and polish those files again before deciding whether to push changes or leave a blocking comment.
86+
87+
Do not add churn. If the translation is already good enough and the PR body already has current A- or higher grades, leave it unchanged.
8588

8689
## Files you may change
8790

@@ -104,22 +107,27 @@ Do not edit:
104107
- Example: compare `translations/es/README.md` with `README.md`.
105108
- Example: compare `translations/es/03-development-workflows/README.md` with `03-development-workflows/README.md`.
106109
3. Focus on files changed by the pull request, not every translated file in the repository.
107-
4. Preserve Markdown structure exactly unless a link or heading fix is required.
108-
5. Apply the shared quality rules and the language quality profile for each target language present in the pull request.
109-
6. Run the deterministic cleanup script after edits:
110+
4. If the pull request body already has a managed `## Translation Quality Review` section, identify files with grades below A- and repair those files first.
111+
5. Preserve Markdown structure exactly unless a link or heading fix is required.
112+
6. Apply the shared quality rules and the language quality profile for each target language present in the pull request.
113+
7. Run an untranslated learner-facing text pass:
114+
- Check headings, visible table headers, navigation tables, list labels, callout/admonition labels, and human-facing link labels.
115+
- Translate leftover English when it is learner-facing prose.
116+
- Preserve product names, commands, file paths, branch names, package names, URLs, badge URLs, code identifiers, and GitHub UI labels that learners must recognize.
117+
8. Run the deterministic cleanup script after edits:
110118

111119
```bash
112120
node .github/scripts/fix-translated-markdown.js "<language-codes>"
113121
```
114122

115-
7. Perform a final review of each changed target-language file against its English source file. Grade each file using A, A-, B+, B, B-, C, D, or F.
116-
8. Continue improving the translation until every changed target-language file earns **A- or higher**.
117-
9. If any changed target-language file remains below A- after reasonable polishing, do not push changes and do not add the `translation-polished` label. Add a pull request comment explaining the blocking issues and the current file grades.
118-
10. Review your final diff. If it contains anything outside `translations/**/*.md`, revert those changes.
119-
11. Push your changes to the target pull request branch using the safe output only when every changed target-language file is A- or higher.
120-
12. Update the pull request body with a final per-file grade table using the instructions in **Pull request body update**.
121-
13. Add the `translation-polished` label only when every changed target-language file is A- or higher.
122-
14. Add a short pull request comment summarizing what was polished, which languages were touched, and the final grade range.
123+
9. Perform a final review of each changed target-language file against its English source file. Grade each file using A, A-, B+, B, B-, C, D, or F.
124+
10. Continue improving the translation until every changed target-language file earns **A- or higher**.
125+
11. If any changed target-language file remains below A- after reasonable polishing, do not push changes and do not add the `translation-polished` label. Update the pull request body with `Translation status: Needs polish` and add a pull request comment explaining the blocking issues and current file grades.
126+
12. Review your final diff. If it contains anything outside `translations/**/*.md`, revert those changes.
127+
13. Push your changes to the target pull request branch using the safe output only when every changed target-language file is A- or higher.
128+
14. Update the pull request body with a final per-file grade table using the instructions in **Pull request body update**.
129+
15. Add the `translation-polished` label only when every changed target-language file is A- or higher.
130+
16. Add a short pull request comment summarizing what was polished, which languages were touched, and the final grade range.
123131

124132
## Quality checklist
125133

@@ -130,7 +138,7 @@ For every translated Markdown file you edit:
130138
- Preserve Markdown tables, lists, blockquotes, headings, and admonitions.
131139
- Preserve links and image destinations. Translate only the human-facing link label when appropriate.
132140
- Translate human-facing prose naturally for the target language.
133-
- Translate visible table headings and list labels when they are human-facing content.
141+
- Translate visible headings, table headings, navigation labels, list labels, callout labels, and link labels when they are human-facing content.
134142
- Keep the beginner-friendly tone of the English source.
135143
- Avoid literal phrasing that sounds unnatural in the target language.
136144
- Do not remove the Co-op Translator disclaimer.
@@ -199,29 +207,41 @@ Apply the profile only when that language is present in the pull request.
199207

200208
## Pull request body update
201209

202-
After the final review, update the pull request body with a managed translation-quality section.
210+
After the final review, update the pull request body with a managed translation-quality section. Replace only the managed block between these markers:
211+
212+
```markdown
213+
<!-- translation-quality-review:start -->
214+
<!-- translation-quality-review:end -->
215+
```
203216

204-
The body must include exactly one section with this heading:
217+
The body must include exactly one managed block and exactly one section inside that block with this heading:
205218

206219
```markdown
207220
## Translation Quality Review
208221
```
209222

210-
If the section already exists, replace the entire existing section with the new one. Do not append duplicates.
223+
If an older unmarked `## Translation Quality Review` section already exists, replace it with the marked block. Do not append duplicates. Do not place generated workflow footers, integrity notes, or unrelated comments inside the managed block.
211224

212225
Use this format:
213226

214227
```markdown
228+
<!-- translation-quality-review:start -->
215229
## Translation Quality Review
216230

231+
**Translation status:** Accepted
232+
**Files reviewed:** 34 total, 34 accepted, 0 needs polish
233+
217234
| Language | File | Final grade | Notes |
218235
|---|---|---:|---|
219236
| es | `translations/es/README.md` | A- | Preserves structure and reads naturally after polish. |
220237

221238
All changed translated Markdown files must be graded **A- or higher** before this PR is marked `translation-polished`.
239+
<!-- translation-quality-review:end -->
222240
```
223241

224-
Include one row for every changed translated Markdown file in the target pull request. Keep notes concise and specific.
242+
Use `Translation status: Accepted` only when every changed translated Markdown file is graded A- or higher. Otherwise use `Translation status: Needs polish`, include counts for total files, accepted files, and files that need polish, and keep the `translation-polished` label off the PR.
243+
244+
Include one row for every changed translated Markdown file in the target pull request. Keep notes concise and specific. For below-threshold files, the note must state the highest-impact issue to fix.
225245

226246
## Pull request comment
227247

0 commit comments

Comments
 (0)