Update statistics of translation #305
This file contains 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
name: Update English PO files for translation | |
on: | |
push: | |
branches: | |
- release_3.28 | |
paths: | |
- 'docs/**' | |
schedule: #run at 02:00 UTC on Wednesday | |
- cron: '00 02 * * 03' | |
workflow_dispatch: | |
jobs: | |
prepare_translation: | |
if: github.repository_owner == 'qgis' | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: release_3.28 | |
- name: Set up Python 3.7 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.7 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install sphinx sphinx-intl sphinxext.rediraffe pyYAML sphinx_togglebutton sphinx_copybutton | |
- name: Generate English PO files | |
id: "generate-po-files" | |
run: | | |
make gettext | |
sphinx-intl update -p build/gettext -l en | |
# Remove obsolete strings from the generated *.po files | |
find locale/en/LC_MESSAGES/docs/ -type f -name '*.po' -exec sed -i '/^#~ /,/^$/d' {} \; | |
- name: Commit the changes in the PO files | |
id: "auto-commit-action" | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Update English PO files | |
- name: "Inform that changes have been made" | |
if: steps.auto-commit-action.outputs.changes_detected == 'true' | |
run: echo "Changes committed!" | |
- name: "Inform that no changes were performed" | |
if: steps.auto-commit-action.outputs.changes_detected == 'false' | |
run: echo "No Changes detected!" |