name: Check translations

on:
  push:
    paths:
    - 'locales/*.po'
  pull_request:
    paths:
    - 'locales/*.po'

jobs:
  check-po-validity:
    name: Check translations
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Install GNU gettext
      run: sudo apt-get install gettext

    - name: Check PO files with msgfmt -v -c
      run: |
        for i in locales/*.po ; do
          echo "checking $i..."
          msgfmt -v -c -o /dev/null $i
        done
