Skip to content

Updates translation file (.ts) (#382) #730

Updates translation file (.ts) (#382)

Updates translation file (.ts) (#382) #730

Workflow file for this run

name: TranslationFilesCheck
env:
VALIDATE_FILE: "is_file"
on:
push:
branches: [develop]
jobs:
translation:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install packages
run: |
sudo apt-get update
sudo apt install qttools5-dev-tools
python -m pip install -U pip qgis-plugin-ci
- name: Create translatable files
run: |
python qaequilibrae/i18n/create_pro_file.py
pylupdate5 qaequilibrae/i18n/qaequilibrae.pro
rm qaequilibrae/i18n/qaequilibrae.pro
- name: Check if there are modifications in the translation files
id: check-modifications
run: |
git fetch --no-tags --depth=1 origin develop
files_changed=$(git diff --name-only)
if echo "${files_changed}" | grep --quiet "qaequilibrae/i18n/qaequilibrae.ts"; then
echo "is_file=$is_file" >> $GITHUB_OUTPUT
else
echo "Translation file wasn't modified."
fi
- name: Create PR
if: steps.check-modifications.outputs.is_file == ${{ env.VALIDATE_FILE }}
uses: peter-evans/create-pull-request@v6
with:
commit-message: Updates translation file (.ts)
title: Updates translation file
body: |
- Updates contents in the main translation file
Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
branch: update-ts