Repository navigation
Merge pull request #918 from Mathide-Team/feat/910-annotations-cli-api #303
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # .github/workflows/i18n.yml -- mise à jour des catalogues de traduction | |
| # gettext (issue #299). | |
| # | |
| # Le job « check » (validation des catalogues sur PR/push) a été fusionné | |
| # dans ci.yml (issue #463) pour réduire le nombre de workflows parallèles. | |
| # Ce fichier ne conserve que le job « update » : régénération des catalogues | |
| # et ouverture d'une PR de mise à jour, sur push vers dev ou lancement manuel. | |
| name: Mise à jour i18n | |
| on: | |
| push: | |
| branches: [dev] | |
| paths: | |
| - "src/**/*.py" | |
| - "lang/**" | |
| - "scripts/i18n-update.sh" | |
| - "scripts/i18n_report.py" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| concurrency: | |
| group: i18n-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Installer gettext | |
| run: | | |
| sudo DEBIAN_FRONTEND=noninteractive apt-get update -qq | |
| sudo DEBIAN_FRONTEND=noninteractive apt-get install -y -qq gettext | |
| - name: Regenerer les catalogues | |
| run: ./scripts/i18n-update.sh | |
| - name: PR de mise a jour | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| BASE: ${{ github.ref_name }} | |
| run: | | |
| if git diff --quiet -- lang/ && [ -z "$(git ls-files --others --exclude-standard lang/)" ]; then | |
| echo "Catalogues deja a jour." | |
| exit 0 | |
| fi | |
| branch="chore/i18n-catalogs-$BASE" | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git switch -C "$branch" | |
| git add lang/ | |
| git commit -m "chore(i18n): update translation catalogs" | |
| git push --force-with-lease origin "$branch" | |
| if [ -z "$(gh pr list --head "$branch" --base "$BASE" --state open --json number -q '.[].number')" ]; then | |
| gh pr create --base "$BASE" --head "$branch" \ | |
| --title "chore(i18n): update translation catalogs" \ | |
| --body "Mise a jour automatique de \`lang/\` (xgettext + msgmerge). Les nouvelles chaines ont \`msgstr \"\"\` : a traduire et relire, aucune traduction automatique n'est inseree." | |
| fi |