Skip to content

Commit

Permalink
add update po
Browse files Browse the repository at this point in the history
  • Loading branch information
shun2wang committed Dec 15, 2023
1 parent 6556745 commit 8d2d8a3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/translation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ jobs:
with:
python-version: "3.10"

- name: Update .po tiles
run: |
pip install Babel
python3 pybabel update --input-file=${{ github.workspace }}/psychopy/localization/messages.pot \
--output-dir=${{ github.workspace }}/psychopy/app/locale/
- name: Compiling .mo files
run: |
set -x
Expand All @@ -30,14 +36,16 @@ jobs:
- name: Stage all changes
id: staging
run: |
ls -d ${{ github.workspace }}/psychopy/app/locale/*/*/*.mo | grep -v -E "*/en_US($|/)" | xargs git add -f
ls -d ${{ github.workspace }}/psychopy/app/locale/*/*/*.mo \
| grep -v "/en_US/" | xargs git add .
echo "NUM_OF_STAGED=$(git diff --staged --name-only | wc -l)" >> $GITHUB_OUTPUT
- name: Push translation changes
if: steps.staging.outputs.NUM_OF_STAGED > 0
run: |
git config user.name github-actions
git config user.email github-actions@github.com
ls -d ${{ github.workspace }}/psychopy/app/locale/*/*/*.mo | grep -v -E "*/en_US($|/)" | xargs git add
ls -d ${{ github.workspace }}/psychopy/app/locale/*/*/*.mo \
| grep -v "/en_US/" | xargs git add .
git commit -m "[bot] Docs: Update translations"
git push
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*.so
*.egg
.eggs
psychopy/app/locale/**/LC_MESSAGE/messages.mo
#psychopy/app/locale/**/LC_MESSAGE/messages.mo

# Python files #
################
Expand Down

0 comments on commit 8d2d8a3

Please sign in to comment.