diff --git a/.github/workflows/msgfmt.py b/.github/workflows/msgfmt.py index dbd151d6212..392b7b636cc 100644 --- a/.github/workflows/msgfmt.py +++ b/.github/workflows/msgfmt.py @@ -239,6 +239,7 @@ def main(): return for filename in args: + print("----------------------------------------------") print(filename, outfile) make(filename, outfile) diff --git a/.github/workflows/translation.yml b/.github/workflows/translation.yml index 14b7ac5085a..9076a156a1a 100644 --- a/.github/workflows/translation.yml +++ b/.github/workflows/translation.yml @@ -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 @@ -30,7 +38,8 @@ 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 @@ -38,6 +47,7 @@ jobs: 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 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 957d2ed6526..8e296efb2cb 100644 --- a/.gitignore +++ b/.gitignore @@ -32,7 +32,7 @@ *.so *.egg .eggs -psychopy/app/locale/**/LC_MESSAGE/messages.mo +#psychopy/app/locale/**/LC_MESSAGE/messages.mo # Python files # ################ diff --git a/psychopy/app/locale/zh_CN/LC_MESSAGE/messages.po b/psychopy/app/locale/zh_CN/LC_MESSAGE/messages.po index 7339e8cddf0..acbe10f7a6d 100644 --- a/psychopy/app/locale/zh_CN/LC_MESSAGE/messages.po +++ b/psychopy/app/locale/zh_CN/LC_MESSAGE/messages.po @@ -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" @@ -7113,7 +7113,7 @@ msgstr "" #: ../monitors/MonitorCenter.py:401 msgid "Get Photometer" -msgstr 获取光度计"" +msgstr "获取光度计" #: ../monitors/MonitorCenter.py:407 msgid "Gamma Calibration..."