Merge pull request #10138 from nupplaphil/feat/auto_transifex

Auto-Test for messages.po update
This commit is contained in:
Hypolite Petovan 2021-04-10 16:26:10 -04:00 committed by GitHub
commit 9cc841f6e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8589 additions and 8558 deletions

30
.github/workflows/transifex.yml vendored Normal file
View file

@ -0,0 +1,30 @@
name: Transifex
on: [push, pull_request]
jobs:
messages:
name: Check messages.po changes
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
- name: Check if messages.po needs an update
run: |
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"
if [[ $(git diff -U0 ./view/lang/C/messages.po | awk '!/@@|-"POT-Creation-Date|+"POT-Creation-Date|-#|+#/{print }' | wc -l) > 4 ]]; then
echo "::error file=messages.po::messages.po is out of date"
exit 1
else
echo "Nothing to update"
fi
echo "::endgroup::"
shell: bash

View file

@ -61,7 +61,7 @@ KEYWORDS="-k -kt -ktt:1,2"
echo "Extract strings to $OUTFILE.." echo "Extract strings to $OUTFILE.."
rm "$OUTFILE"; touch "$OUTFILE" rm "$OUTFILE"; touch "$OUTFILE"
find_result=$(find "$FINDSTARTDIR" $FINDOPTS -name "*.php" -type f) find_result=$(find "$FINDSTARTDIR" $FINDOPTS -name "*.php" -type f | sort)
total_files=$(wc -l <<< "${find_result}") total_files=$(wc -l <<< "${find_result}")

File diff suppressed because it is too large Load diff