Skip to content

Commit

Permalink
Add automated workflow for xgettext
Browse files Browse the repository at this point in the history
  • Loading branch information
swsnr committed Nov 13, 2024
1 parent cb95062 commit 6a4532a
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/gettext.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Handle gettext

on:
push:
branches: ["main"]
paths:
- src/**/*.rs
- resources/**/*.blp
- resources/de.swsnr.turnon.metainfo.xml.in
- de.swsnr.turnon.desktop.in

jobs:
xgettext:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Install gettext
run: |
sudo apt-get update -qq
sudo apt-get install --no-install-recommends -qq -y gettext
- run: make pot
# Create a pull request to update the messages file
- uses: peter-evans/create-pull-request@v7
with:
commit-message: "Update messages"
branch: workflow/update-messages
base: main
sign-commits: true
delete-branch: true
title: "Automated update of messages"
body: "Github bot runs make pot :v:"
assignees: swsnr
draft: true
add-paths: po/de.swsnr.turnon.pot
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ XGETTEXT_OPTS = \
--foreign-user --copyright-holder "Sebastian Wiesner <[email protected]>" \
--sort-by-file --from-code=UTF-8 --add-comments

# When changing the set of files taken into account for xgettext also update the
# paths list in the gettext.yml workflow to make sure that updates to these
# files are caught by the gettext workflows.
.PHONY: pot
pot:
find src -name '*.rs' > po/POTFILES.rs
Expand Down

0 comments on commit 6a4532a

Please sign in to comment.