Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

i18n.yml 1.3 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. name: Internationalization check
  2. on: [push, pull_request]
  3. jobs:
  4. build:
  5. runs-on: ubuntu-latest
  6. steps:
  7. - uses: actions/checkout@v1
  8. - name: Set up Python
  9. uses: actions/setup-python@v1
  10. with:
  11. python-version: 3.8
  12. - name: Install dependencies
  13. run: |
  14. pip install --upgrade pip pipenv
  15. pipenv sync -d
  16. - name: Check i18n
  17. run: |
  18. pipenv run python setup.py extract_messages --output-file=/tmp/kosmorro-messages.pot > /dev/null
  19. diff=$(diff kosmorrolib/locales/messages.pot /tmp/kosmorro-messages.pot | grep '^>')
  20. n=$(echo "$diff" | grep -v '> "POT-Creation-Date: ' | wc -l)
  21. if [ "$(echo "$diff" | grep -E '^"Generated-By: Babel' | wc -l)" -eq "1" ]; then
  22. echo "❌ You dependencies may be out of date!"
  23. echo " Please run the following command to fix this:"
  24. echo
  25. echo " pipenv sync --dev"
  26. echo
  27. echo " Then update the messages file:"
  28. echo
  29. echo " make messages"
  30. exit 2
  31. fi
  32. if [ "$n" -ne "0" ]; then
  33. echo "❌ The messages file is not up-to-date!"
  34. echo " Please run the following command to fix this:"
  35. echo
  36. echo " make messages"
  37. exit 1
  38. fi
  39. echo "✔ Messages file up-to-date."