Skip to content

Commit e57b052

Browse files
committed
Refactor translation workflows to streamline commit and PR creation steps. Updated instructions for editing translation files and removed redundant automation steps, enhancing clarity and efficiency in managing translation updates.
1 parent ff3b6f3 commit e57b052

2 files changed

Lines changed: 18 additions & 54 deletions

File tree

.github/workflows/translate-docs.yml

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -112,35 +112,17 @@ 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.
116115
- If there are no missing translations, do nothing
116+
117+
After translating, commit and open a PR using these exact steps (run each command separately, use only single-line messages with no newlines):
118+
1. git checkout -b update-docs-translations
119+
2. git add docs/messages/
120+
3. git commit -m "Update docs translations"
121+
4. git push origin update-docs-translations
122+
5. gh pr create --title "Update docs translations" --body "Automated translation update: filled missing/empty translation keys across all locale files."
117123
claude_args: >-
118124
--model claude-sonnet-4-6
119125
--max-turns 50
120126
--allowedTools "Edit" "Read" "Write" "Glob" "Grep"
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-
git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
128-
129-
if git diff --quiet docs/messages/; then
130-
echo "No translation changes to commit."
131-
exit 0
132-
fi
133-
134-
BRANCH="update-docs-translations-$(date +%Y%m%d%H%M%S)"
135-
git checkout -b "$BRANCH"
136-
git add docs/messages/
137-
git commit -m "Update docs translations"
138-
git push origin "$BRANCH"
139-
140-
gh pr create \
141-
--title "Update docs translations" \
142-
--body "Automated translation update: filled missing/empty translation keys across all locale files." \
143-
--base master \
144-
--head "$BRANCH"
145-
env:
146-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
127+
"Bash(python3 *)" "Bash(git checkout *)" "Bash(git add *)"
128+
"Bash(git commit *)" "Bash(git push *)" "Bash(gh pr create *)"

.github/workflows/translate.yml

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -111,35 +111,17 @@ jobs:
111111
- Keep translations natural and idiomatic, not literal
112112
- Maintain consistent terminology within each language file
113113
- Do NOT modify en.json
114-
- Only edit the translation JSON files. Do not run any git commands or create PRs.
115114
- If there are no missing translations, do nothing
115+
116+
After translating, commit and open a PR using these exact steps (run each command separately, use only single-line messages with no newlines):
117+
1. git checkout -b update-translations
118+
2. git add client/messages/
119+
3. git commit -m "Update translations"
120+
4. git push origin update-translations
121+
5. gh pr create --title "Update translations" --body "Automated translation update: filled missing/empty translation keys across all locale files."
116122
claude_args: >-
117123
--model claude-sonnet-4-6
118124
--max-turns 50
119125
--allowedTools "Edit" "Read" "Write" "Glob" "Grep"
120-
"Bash(python3 *)"
121-
122-
- name: Commit and open PR
123-
run: |
124-
git config user.name "github-actions[bot]"
125-
git config user.email "github-actions[bot]@users.noreply.github.com"
126-
git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
127-
128-
if git diff --quiet client/messages/; then
129-
echo "No translation changes to commit."
130-
exit 0
131-
fi
132-
133-
BRANCH="update-translations-$(date +%Y%m%d%H%M%S)"
134-
git checkout -b "$BRANCH"
135-
git add client/messages/
136-
git commit -m "Update translations"
137-
git push origin "$BRANCH"
138-
139-
gh pr create \
140-
--title "Update 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 }}
126+
"Bash(python3 *)" "Bash(git checkout *)" "Bash(git add *)"
127+
"Bash(git commit *)" "Bash(git push *)" "Bash(gh pr create *)"

0 commit comments

Comments
 (0)