Skip to content

chore(translations): merge new un-translated string(s) to existing .p… #81

chore(translations): merge new un-translated string(s) to existing .p…

chore(translations): merge new un-translated string(s) to existing .p… #81

name: Compile .mo files
on:
workflow_dispatch:
push:
paths:
- ardupilot_methodic_configurator/locale/**/ardupilot_methodic_configurator.po
# prevent race conditions
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
compile-mo-files:
permissions:
contents: write # for creating branches and commits
pull-requests: write # for creating PRs
runs-on: ubuntu-latest
env:
MO_FILES_CHANGED: false
steps:
- name: Checkout MethodicConfigurator
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: '3.x'
- name: Install apt packages
run: |
sudo apt-get update
sudo apt-get install -y gettext
- name: Compile translation .mo files from the .po files
run: python create_mo_files.py
- name: Stage changes
run: |
git add ardupilot_methodic_configurator/locale/**/ardupilot_methodic_configurator.mo
if [ -n "$(git status --porcelain)" ]; then
echo "MO_FILES_CHANGED=true" >> $GITHUB_ENV
else
echo "No changes to commit"
fi
- name: Create Pull Request
if: env.MO_FILES_CHANGED == 'true'
uses: peter-evans/create-pull-request@dd2324fc52d5d43c699a5636bcf19fceaa70c284 # v7.0.7
with:
labels: i18n, automated-pr
token: ${{ secrets.GITHUB_TOKEN }}
branch: compile-mo-translation-files
title: "Compile .mo translation files"
commit-message: "chore(translations): Compile translation .mo files from the .po files"
body: |
This PR Compiles .mo files based on the latest changes to .po translation files.
delete-branch: true