You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

39 lines
1.0 KiB

  1. name: Internationalization check
  2. on:
  3. push:
  4. branches: [master, features]
  5. pull_request:
  6. branches: [master, features]
  7. jobs:
  8. internationalization:
  9. runs-on: ubuntu-latest
  10. steps:
  11. - uses: actions/checkout@v3
  12. - name: Set up Python
  13. uses: actions/setup-python@v4
  14. with:
  15. python-version: '3.x'
  16. - name: Install dependencies
  17. run: |
  18. pip install --upgrade pip poetry
  19. poetry install
  20. - name: Check i18n
  21. run: |
  22. poetry run pybabel extract --output=/tmp/kosmorro-messages.pot kosmorro
  23. echo
  24. diff=$(diff kosmorro/locales/messages.pot /tmp/kosmorro-messages.pot | grep '^>')
  25. n=$(echo "$diff" | grep -Ev '> "(POT-Creation-Date)|(Generated-By): ' | wc -l)
  26. if [ "$n" -ne "0" ]; then
  27. echo "❌ The messages file is not up-to-date!"
  28. echo " Please run the following command to fix this:"
  29. echo
  30. echo " make messages"
  31. exit 1
  32. fi
  33. echo "✔ Messages file up-to-date."