Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 

50 řádky
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@v1
  12. - name: Set up Python
  13. uses: actions/setup-python@v1
  14. with:
  15. python-version: 3.8
  16. - name: Install dependencies
  17. run: |
  18. pip install --upgrade pip pipenv
  19. pipenv sync -d
  20. - name: Check i18n
  21. run: |
  22. pipenv run python setup.py extract_messages --output-file=/tmp/kosmorro-messages.pot > /dev/null
  23. diff=$(diff kosmorro/locales/messages.pot /tmp/kosmorro-messages.pot | grep '^>')
  24. n=$(echo "$diff" | grep -v '> "POT-Creation-Date: ' | wc -l)
  25. if [ "$(echo "$diff" | grep -E '^"Generated-By: Babel' | wc -l)" -eq "1" ]; then
  26. echo "❌ You dependencies may be out of date!"
  27. echo " Please run the following command to fix this:"
  28. echo
  29. echo " pipenv sync --dev"
  30. echo
  31. echo " Then update the messages file:"
  32. echo
  33. echo " make messages"
  34. exit 2
  35. fi
  36. if [ "$n" -ne "0" ]; then
  37. echo "❌ The messages file is not up-to-date!"
  38. echo " Please run the following command to fix this:"
  39. echo
  40. echo " make messages"
  41. exit 1
  42. fi
  43. echo "✔ Messages file up-to-date."