Skip to content

Translations update from Hosted Weblate #297

Translations update from Hosted Weblate

Translations update from Hosted Weblate #297

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@v5
with:
python-version: >-
3.10
- name: Install Python tooling
run: python -m pip install --upgrade nox virtualenv sphinx-lint
- name: Set Sphinx problem matcher
uses: sphinx-doc/[email protected]
- name: Build translated docs in ${{ matrix.language }}
run: nox -s build -- -q -D language=${{ matrix.language }}
- name: Set Sphinx Lint problem matcher
if: always()
run: echo '::add-matcher::.github/sphinx_lint_matcher.json'
- name: Lint translation file
if: always()
run: sphinx-lint locales/${{ matrix.language }}/LC_MESSAGES/messages.po