fix path type #89
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate Psychopy translations | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- testTranslationWorkflow | |
#paths: | |
# - "**.po" | |
jobs: | |
update_translations: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Update .po tiles | |
run: | | |
sudo pip install Babel | |
set -x | |
find -name messages.pot | |
messages_pot=$(find -name messages.pot) | |
for x in $(find ./psychopy/app/locale -type d); do | |
pybabel update --input-file="$messages_pot" --output-dir="${x}/"; | |
done | |
- name: Compiling .mo files | |
run: | | |
set -x | |
for x in ${{ github.workspace }}/psychopy/app/locale/*/*/*.po ; do | |
python3 .github/workflows/msgfmt.py --output-file "`dirname "$x"`/`basename "$x" .po`.mo" "$x" ; | |
done | |
# - name: Compiling .mo files | |
# run: | | |
# set -x | |
# for x in ${{ github.workspace }}/psychopy/app/locale/*/*/*.po ;\ | |
# do pybabel compile -i $x -o "$x".mo; \ | |
# done | |
- name: Stage all changes | |
id: staging | |
run: | | |
git add "*.po" | |
git add "*.mo" | |
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 [email protected] | |
git commit -m "[bot] Docs: Update translations" | |
git push |