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.
 
 
 
 

51 lines
1.4 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@v2
  12. - name: Set up Python
  13. uses: actions/setup-python@v2
  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 -v '> "POT-Creation-Date: ' | wc -l)
  26. if [ "$(echo "$diff" | grep -E '^"Generated-By: Babel' | wc -l)" -eq "1" ]; then
  27. echo "❌ Your dependencies may be out of date!"
  28. echo " Please run the following command to fix this:"
  29. echo
  30. echo " poetry install"
  31. echo
  32. echo " Then update the messages file:"
  33. echo
  34. echo " make messages"
  35. exit 2
  36. fi
  37. if [ "$n" -ne "0" ]; then
  38. echo "❌ The messages file is not up-to-date!"
  39. echo " Please run the following command to fix this:"
  40. echo
  41. echo " make messages"
  42. exit 1
  43. fi
  44. echo "✔ Messages file up-to-date."