Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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