Skip to content

Commit 78337f7

Browse files
committed
Fix locale-update workflow to use correct messages.po path
- Update path from locale/messages.po to locale/terms/messages.po - Add file existence check before diff - Use -- separator for git diff to avoid ambiguous argument error - Also add locale/terms/base/ to commit for generated base files
1 parent 1ec8e5c commit 78337f7

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

.github/workflows/locale-update.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,24 @@ jobs:
5555
id: check_changes
5656
run: |
5757
# Check if there are any changes to .po files
58-
if git diff --quiet locale/messages.po; then
58+
# The main messages.po is in locale/terms/messages.po
59+
PO_FILE="locale/terms/messages.po"
60+
61+
if [ ! -f "$PO_FILE" ]; then
62+
echo "has_changes=false" >> $GITHUB_OUTPUT
63+
echo "No messages.po file found at $PO_FILE"
64+
exit 0
65+
fi
66+
67+
if git diff --quiet -- "$PO_FILE"; then
5968
echo "has_changes=false" >> $GITHUB_OUTPUT
6069
echo "No changes detected in locale files"
6170
exit 0
6271
fi
6372
6473
# Check if changes are only in the header (first 20 lines typically contain headers)
6574
# We'll check if there are changes beyond line 25 to be safe
66-
CHANGES=$(git diff locale/messages.po | grep -E '^\+[^+]|^\-[^-]' | tail -n +25 | wc -l)
75+
CHANGES=$(git diff -- "$PO_FILE" | grep -E '^\+[^+]|^\-[^-]' | tail -n +25 | wc -l)
6776
6877
if [ "$CHANGES" -gt 0 ]; then
6978
echo "has_changes=true" >> $GITHUB_OUTPUT
@@ -90,7 +99,7 @@ jobs:
9099
- name: Commit locale changes
91100
if: steps.check_changes.outputs.has_changes == 'true'
92101
run: |
93-
git add locale/messages.po src/locale/i18n/
102+
git add locale/terms/messages.po locale/terms/base/ src/locale/i18n/
94103
git commit -m "Update locale strings from source code"
95104
96105
- name: Push branch
@@ -116,7 +125,7 @@ jobs:
116125
Message: $TRIGGER_COMMIT_MSG
117126
118127
## Changes
119-
- Updated \`locale/messages.po\` with new/modified translatable strings
128+
- Updated \`locale/terms/messages.po\` with new/modified translatable strings
120129
- Updated JSON locale keys
121130
122131
## Next Steps

0 commit comments

Comments
 (0)