Skip to content

Commit

Permalink
find messages.pot
Browse files Browse the repository at this point in the history
  • Loading branch information
shun2wang committed Dec 15, 2023
1 parent 0921e49 commit 5d98bf6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/msgfmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ def main():
return

for filename in args:
print("----------------------------------------------")
print(filename, outfile)
make(filename, outfile)

Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/translation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ jobs:
with:
python-version: "3.10"

- name: Update .po tiles
run: |
pip install Babel
set -x
find -name messages.pot
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 +38,16 @@ jobs:
- name: Stage all changes
id: staging
run: |
ls -d ${{ github.workspace }}/psychopy/app/locale/*/*/*.mo | grep -v "en-GB" | 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 "en-GB" | 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
4 changes: 2 additions & 2 deletions psychopy/app/locale/zh_CN/LC_MESSAGE/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ msgstr ""

#: __init__.py:48
msgid "Welcome to PsychoPy2!"
msgstr "欢迎使用 PsychoPy"
msgstr "欢迎使用 PsychoPy!"

#: ../alerts/_alerts.py:121 ../alerts/_alerts.py:123
msgid "msg"
Expand Down Expand Up @@ -7113,7 +7113,7 @@ msgstr ""

#: ../monitors/MonitorCenter.py:401
msgid "Get Photometer"
msgstr 获取光度计""
msgstr "获取光度计"

#: ../monitors/MonitorCenter.py:407
msgid "Gamma Calibration..."
Expand Down

0 comments on commit 5d98bf6

Please sign in to comment.