From e84c3dbb76901f14ac86bb61f8ad7ce3fa85ffb0 Mon Sep 17 00:00:00 2001 From: Chatewgne Date: Tue, 28 May 2024 17:07:20 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20[CI]=20Add=20job=20to=20check=20?= =?UTF-8?q?translations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/lint.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 758254c7f1..bd94b3ad8e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -36,3 +36,35 @@ jobs: - name: Flake8 run: | flake8 geotrek + + translations: + name: Checking .po files are up-to-date + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: ./.github/actions/python-cache-requirements + with: + requirements: requirements.txt + + - name: Prepare test env + run: | + sudo apt-get update -q + sudo apt-get -qq -y install gettext + + - name: Generate translation files + run: | + python3 ./manage.py makemessages -a --no-location --no-obsolete + + - uses: tj-actions/verify-changed-files@v18 + id: verify-changed-files + with: + files: | + **/*.po + + - name: Verify translation files changed + if: steps.verify-changed-files.outputs.files_changed == 'true' + run: | + echo "Translation file(s) changed: ${{ steps.verify-changed-files.outputs.changed_files }}" + git diff + core.setFailed('Please fix your translation files with ./manage.py makemessages -a --no-location --no-obsolete')