Translations update from Hosted Weblate (#1928) #255
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
| name: Merge | |
| 'on': | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| flatpak: | |
| name: flatpak | |
| runs-on: ubuntu-latest | |
| container: | |
| image: 'ghcr.io/flathub-infra/flatpak-github-actions:gnome-48' | |
| options: '--privileged' | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: flatpak/flatpak-github-actions/flatpak-builder@v6 | |
| with: | |
| bundle: planify.Devel.flatpak | |
| manifest-path: build-aux/io.github.alainm23.planify.Devel.json | |
| cache-key: 'flatpak-builder-${{ github.sha }}' | |
| gettext: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install gettext | |
| run: sudo apt-get update && sudo apt-get install -y gettext | |
| - name: Pull latest changes | |
| run: | | |
| git config --local user.name "Planify Bot" | |
| git config --local user.email "[email protected]" | |
| git fetch origin master | |
| git rebase origin/master || true | |
| - name: Update POTFILES and translations | |
| run: | | |
| # Regenerate POTFILES | |
| cat > po/POTFILES << 'EOF' | |
| # List of source files containing translatable strings. | |
| # Please keep this file sorted alphabetically. | |
| EOF | |
| find core -name "*.vala" | sort >> po/POTFILES | |
| echo >> po/POTFILES | |
| find src -name "*.vala" | sort >> po/POTFILES | |
| echo >> po/POTFILES | |
| find quick-add -name "*.vala" | sort >> po/POTFILES | |
| echo >> po/POTFILES | |
| echo "data/resources/ui/shortcuts.ui" >> po/POTFILES | |
| # Update translations | |
| xgettext --files-from=po/POTFILES --directory=. \ | |
| --output=po/io.github.alainm23.planify.pot --from-code=UTF-8 \ | |
| --keyword=_ --keyword=N_ | |
| for lang in $(cat po/LINGUAS); do | |
| msgmerge --update --no-fuzzy-matching --backup=none po/$lang.po po/io.github.alainm23.planify.pot | |
| done | |
| - name: Check for real changes | |
| id: check_changes | |
| run: | | |
| # Exclude date-only changes (POT-Creation-Date and PO-Revision-Date) | |
| if git diff --ignore-matching-lines='^"POT-Creation-Date:' \ | |
| --ignore-matching-lines='^"PO-Revision-Date:' \ | |
| --quiet po/; then | |
| echo "has_changes=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "has_changes=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Resolve conflicts if any | |
| run: | | |
| if [ -f po/io.github.alainm23.planify.pot ]; then | |
| git add po/io.github.alainm23.planify.pot | |
| fi | |
| git rebase --continue || true | |
| - name: Commit and push changes | |
| if: steps.check_changes.outputs.has_changes == 'true' | |
| run: | | |
| git add po/ | |
| git diff --staged --quiet || git commit -m "Update translations" | |
| git push origin master |