Skip to content

Commit

Permalink
Merge pull request #1431 from rffontenelle/patch-1
Browse files Browse the repository at this point in the history
Test translations for reST syntax errors
  • Loading branch information
webknjaz authored Dec 22, 2023
2 parents e2c2ffa + b553651 commit f34c6d1
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/test-translations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Test translations

on:
workflow_dispatch:
pull_request:
paths:
- '**.po'
branches:
- translation/source
push:
paths:
- '**.po'
branches:
- translation/source

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

env:
I18N_BRANCH: translation/source

jobs:
matrix:
runs-on: ubuntu-latest
outputs:
languages: ${{ steps.languages.outputs.languages }}

steps:
- name: Grab the repo src
uses: actions/checkout@v4
with:
ref: ${{ env.I18N_BRANCH }}

- name: List languages
id: languages
working-directory: locales
run: |
list=$(find * -maxdepth 0 -type d | jq -nRc '[inputs]')
echo "languages=$list" >> $GITHUB_OUTPUT
test-translation:
runs-on: ubuntu-latest
needs: matrix
strategy:
fail-fast: false
matrix:
language: ${{fromJson(needs.matrix.outputs.languages)}}

steps:
- name: Grab the repo src
uses: actions/checkout@v4
with:
ref: ${{ env.I18N_BRANCH }}

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: >-
3.10
- name: Install Python tooling
run: python -m pip install --upgrade nox virtualenv sphinx-lint

- name: Build translated docs in ${{ matrix.language }}
run: nox -s build -- -q -D language=${{ matrix.language }}

- name: Lint translation file
run: sphinx-lint locales/${{ matrix.language }}/LC_MESSAGES/messages.po

0 comments on commit f34c6d1

Please sign in to comment.