diff --git a/.github/workflows/i18n.yaml b/.github/workflows/i18n.yaml new file mode 100644 index 00000000..28fe71ec --- /dev/null +++ b/.github/workflows/i18n.yaml @@ -0,0 +1,39 @@ +name: Check Internationalization +# Ensure that the .po files are up to date with any changes to the guide text + +on: + pull_request: + push: + branches: + - main + +jobs: + update-i18n: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: pip + + - name: Install Nox + run: python3 -m pip install nox + + - name: Update .po files + run: nox -s update-release-languages + + - name: Test for uncommitted changes + run: | + if [ -z "$(git status --porcelain)" ]; + then + echo "No changes detected, translations are up to date!" >> $GITHUB_STEP_SUMMARY + exit 0 + else + echo "Changes to .po files detected, please run `nox -s update-translations` to reflect changes to source text" >> $GITHUB_STEP_SUMMARY + echo "$(git status)" + echo "$(git diff)" + exit 1 + fi