Skip to content

Commit 8d81863

Browse files
committed
Enhance translation workflow by adding automated commit and PR creation for translation updates. Updated max turns for translation model and clarified instructions for editing translation files. This improves efficiency in managing translation changes and ensures consistency across locale files.
1 parent acdfb74 commit 8d81863

1 file changed

Lines changed: 27 additions & 4 deletions

File tree

.github/workflows/translate-docs.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,34 @@ jobs:
112112
- Keep translations natural and idiomatic, not literal
113113
- Maintain consistent terminology within each language file
114114
- Do NOT modify en.json
115+
- Only edit the translation JSON files. Do not run any git commands or create PRs.
115116
- If there are no missing translations, do nothing
116-
117-
After making changes, create a PR with the title "Update docs translations" and a summary of what was added/fixed.
118117
claude_args: >-
119118
--model claude-sonnet-4-6
120-
--max-turns 30
119+
--max-turns 50
121120
--allowedTools "Edit" "Read" "Write" "Glob" "Grep"
122-
"Bash(git *)" "Bash(gh pr *)" "Bash(python3 *)" "Bash(node *)"
121+
"Bash(python3 *)"
122+
123+
- name: Commit and open PR
124+
run: |
125+
git config user.name "github-actions[bot]"
126+
git config user.email "github-actions[bot]@users.noreply.github.com"
127+
128+
if git diff --quiet docs/messages/; then
129+
echo "No translation changes to commit."
130+
exit 0
131+
fi
132+
133+
BRANCH="update-docs-translations-$(date +%Y%m%d%H%M%S)"
134+
git checkout -b "$BRANCH"
135+
git add docs/messages/
136+
git commit -m "Update docs translations"
137+
git push origin "$BRANCH"
138+
139+
gh pr create \
140+
--title "Update docs translations" \
141+
--body "Automated translation update: filled missing/empty translation keys across all locale files." \
142+
--base master \
143+
--head "$BRANCH"
144+
env:
145+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)