Skip to content

Commit c5c67c5

Browse files
DanWahlinCopilot
andcommitted
feat(translations): add per-file polish grades
Updates the Translation Polisher workflow to grade every changed translated Markdown file and maintain a Translation Quality Review section in the PR body. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f83e133 commit c5c67c5

2 files changed

Lines changed: 94 additions & 26 deletions

File tree

.github/workflows/translation-polisher.lock.yml

Lines changed: 52 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/translation-polisher.md

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ safe-outputs:
3737
allowed: [translation-polished]
3838
max: 1
3939
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN }}
40+
update-pull-request:
41+
target: "*"
42+
title: false
43+
body: true
44+
max: 1
45+
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN }}
4046
push-to-pull-request-branch:
4147
target: "*"
4248
labels: [translation, automated-pr]
@@ -104,13 +110,14 @@ Do not edit:
104110
node .github/scripts/fix-translated-markdown.js "<language-codes>"
105111
```
106112

107-
7. Perform a final review of each changed target-language file against its English source file. Grade each language using A, A-, B+, B, B-, C, D, or F.
108-
8. Continue improving the translation until every target language you touched earns **A- or higher**.
109-
9. If any target language 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 grade.
113+
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.
114+
8. Continue improving the translation until every changed target-language file earns **A- or higher**.
115+
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.
110116
10. Review your final diff. If it contains anything outside `translations/**/*.md`, revert those changes.
111-
11. Push your changes to the target pull request branch using the safe output only when every touched language is A- or higher.
112-
12. Add the `translation-polished` label only when every touched language is A- or higher.
113-
13. Add a short pull request comment summarizing what was polished, which languages were touched, and the final grade for each touched language.
117+
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.
118+
12. Update the pull request body with a final per-file grade table using the instructions in **Pull request body update**.
119+
13. Add the `translation-polished` label only when every changed target-language file is A- or higher.
120+
14. Add a short pull request comment summarizing what was polished, which languages were touched, and the final grade range.
114121

115122
## Quality checklist
116123

@@ -129,7 +136,7 @@ For every translated Markdown file you edit:
129136

130137
## Final translation review rubric
131138

132-
Before pushing, review each touched language against the corresponding English source and assign a grade.
139+
Before pushing, review each changed translated Markdown file against its corresponding English source and assign a grade.
133140

134141
Grade **A- or higher** only when all of these are true:
135142

@@ -141,7 +148,7 @@ Grade **A- or higher** only when all of these are true:
141148
- Terminology is consistent within the file and across the same target language.
142149
- The tone remains beginner-friendly, practical, and encouraging.
143150

144-
Use **B+ or lower** if any visible learner-facing text remains unnecessarily in English, if phrasing is noticeably awkward, if terminology is inconsistent, or if important nuance is missing. Keep polishing until the grade is A- or higher.
151+
Use **B+ or lower** if any visible learner-facing text remains unnecessarily in English, if phrasing is noticeably awkward, if terminology is inconsistent, or if important nuance is missing. Keep polishing until every changed translated Markdown file is A- or higher.
145152

146153
## Language quality profiles
147154

@@ -188,13 +195,39 @@ Apply the profile only when that language is present in the pull request.
188195
- Avoid Taiwan/Hong Kong traditional terminology.
189196
- Do not translate commands, file paths, Git branch names, package names, or GitHub UI labels that learners must recognize.
190197

198+
## Pull request body update
199+
200+
After the final review, update the pull request body with a managed translation-quality section.
201+
202+
The body must include exactly one section with this heading:
203+
204+
```markdown
205+
## Translation Quality Review
206+
```
207+
208+
If the section already exists, replace the entire existing section with the new one. Do not append duplicates.
209+
210+
Use this format:
211+
212+
```markdown
213+
## Translation Quality Review
214+
215+
| Language | File | Final grade | Notes |
216+
|---|---|---:|---|
217+
| es | `translations/es/README.md` | A- | Preserves structure and reads naturally after polish. |
218+
219+
All changed translated Markdown files must be graded **A- or higher** before this PR is marked `translation-polished`.
220+
```
221+
222+
Include one row for every changed translated Markdown file in the target pull request. Keep notes concise and specific.
223+
191224
## Pull request comment
192225

193226
After polishing, add a concise comment with:
194227

195228
1. The pull request number reviewed.
196229
2. The languages touched.
197-
3. The final grade for each touched language. Only report `A-` or higher as accepted.
230+
3. The final grade range across changed files. Only report `A-` or higher as accepted.
198231
4. A short summary of improvements, such as link-label translation, terminology consistency, and readability polish.
199232

200233
If no changes are needed, use a no-op and do not comment.

0 commit comments

Comments
 (0)