@@ -27,23 +27,24 @@ jobs:
2727 sudo apt-get -q update
2828 sudo DEBIAN_FRONTEND='noninteractive' apt-get -qq --no-install-recommends install gettext
2929
30- - uses : actions/checkout@v5
30+ - uses : actions/checkout@v6
3131 with :
3232 ref : ${{ github.head_ref }}
3333 # https://github.com/peter-evans/create-pull-request/issues/48
3434 token : ${{ secrets.GH_PAT }}
3535
3636 - name : Generate backend template
3737 run : |
38- pybabel extract -F l10n/babel.cfg -o motioneye/locale/motioneye.pot motioneye/
39- # Remove trailing empty line to satisfy pre-commit
40- sed -i '${/^$/d}' motioneye/locale/motioneye.pot
38+ pybabel extract --no-wrap - F l10n/babel.cfg -o motioneye/locale/motioneye.pot motioneye/
39+ # Remove python-format flag, and trailing empty line to satisfy pre-commit
40+ sed -i -e '/^#, python-format$/d' -e '${/^$/d}' motioneye/locale/motioneye.pot
4141
4242 - name : Generate frontend template
4343 run : xgettext --no-wrap --from-code=UTF-8 -o motioneye/locale/motioneye.js.pot motioneye/static/js/*.js l10n/*.js
4444
4545 - name : Generate frontend locales
4646 run : |
47+ rm motioneye/static/js/motioneye.*.json
4748 for i in motioneye/locale/*/LC_MESSAGES/motioneye.js.po
4849 do
4950 lang=${i#motioneye/locale/}
@@ -52,12 +53,18 @@ jobs:
5253 l10n/po2json "$i" "motioneye/static/js/motioneye.$lang.json"
5354 done
5455
56+ - name : Cleanup backend locales
57+ run : |
58+ for i in motioneye/locale/*/LC_MESSAGES/motioneye.mo
59+ do
60+ [ -f "${i%mo}po" ] || rm "$i"
61+ done
62+
5563 - name : Commit changes
5664 run : |
57- git add -NA
58- git diff -I '^"POT-Creation-Date: ' --exit-code && exit 0
65+ git add -A
66+ git diff -I '^"POT-Creation-Date: ' --exit-code HEAD && exit 0
5967 git config user.name 'github-actions[bot]'
6068 git config user.email 'github-actions[bot]@users.noreply.github.com'
61- git add -A
6269 git commit -m 'Update translation files'
6370 git push
0 commit comments