2021-04-10 08:36:39 -04:00
|
|
|
name: Transifex
|
2021-04-10 06:58:07 -04:00
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
messages:
|
2021-04-10 08:36:39 -04:00
|
|
|
name: Check messages.po changes
|
2021-04-10 06:58:07 -04:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Install gettext
|
|
|
|
run: sudo apt-get install gettext
|
|
|
|
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Run Xgettext
|
|
|
|
run: ./bin/run_xgettext.sh
|
|
|
|
|
2021-04-10 08:36:39 -04:00
|
|
|
- name: Check if messages.po needs an update
|
2021-04-10 06:58:07 -04:00
|
|
|
run: |
|
2021-04-10 08:36:39 -04:00
|
|
|
echo "::group::Check messages.po"
|
|
|
|
# Skip first 4 lines in possible diff, because they're header
|
|
|
|
# Skip all lines of the git diff starting with "@@" or comments or starting "POT-Creation-Date"
|
2021-04-28 16:45:11 -04:00
|
|
|
if [[ $(git diff -U0 ./view/lang/C/messages.po | awk '!/@@|-"POT-Creation-Date|+"POT-Creation-Date|-#|+#/{print }' | wc -l) -gt 4 ]]; then
|
2021-04-10 08:36:39 -04:00
|
|
|
echo "::error file=messages.po::messages.po is out of date"
|
2021-04-28 16:45:11 -04:00
|
|
|
echo "$(git diff ./view/lang/C/messages.po)"
|
2021-04-10 08:36:39 -04:00
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
echo "Nothing to update"
|
|
|
|
fi
|
|
|
|
echo "::endgroup::"
|
|
|
|
shell: bash
|