check-i18n.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. name: Check i18n
  2. on:
  3. push:
  4. branches: [main]
  5. pull_request:
  6. branches: [main]
  7. env:
  8. RAILS_ENV: test
  9. permissions:
  10. contents: read
  11. jobs:
  12. check-i18n:
  13. runs-on: ubuntu-22.04
  14. steps:
  15. - uses: actions/checkout@v4
  16. - name: Install system dependencies
  17. run: |
  18. sudo apt-get update
  19. sudo apt-get install -y libicu-dev libidn11-dev
  20. - name: Set up Ruby
  21. uses: ruby/setup-ruby@v1
  22. with:
  23. ruby-version: .ruby-version
  24. bundler-cache: true
  25. - name: Set up Node.js
  26. uses: actions/setup-node@v3
  27. with:
  28. cache: yarn
  29. node-version-file: '.nvmrc'
  30. - name: Install all yarn packages
  31. run: yarn --frozen-lockfile
  32. - name: Check for missing strings in English JSON
  33. run: |
  34. yarn i18n:extract --throws
  35. git diff --exit-code
  36. - name: Check locale file normalization
  37. run: bundle exec i18n-tasks check-normalized
  38. - name: Check for unused strings
  39. run: bundle exec i18n-tasks unused
  40. - name: Check for missing strings in English YML
  41. run: |
  42. bundle exec i18n-tasks add-missing -l en
  43. git diff --exit-code
  44. - name: Check for wrong string interpolations
  45. run: bundle exec i18n-tasks check-consistent-interpolations
  46. - name: Check that all required locale files exist
  47. run: bundle exec rake repo:check_locales_files