From b47b38448cddca75d10a53076b2fa39717189699 Mon Sep 17 00:00:00 2001 From: Fs00 Date: Sat, 10 Sep 2022 16:00:35 +0200 Subject: [PATCH] Add workflow for generating POT file --- .github/workflows/generate_pot.yml | 42 ++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/generate_pot.yml diff --git a/.github/workflows/generate_pot.yml b/.github/workflows/generate_pot.yml new file mode 100644 index 00000000..f2675574 --- /dev/null +++ b/.github/workflows/generate_pot.yml @@ -0,0 +1,42 @@ +name: Generate translation template + +on: + pull_request: + paths-ignore: + - "*.md" + types: + - opened + - synchronize + - reopened + push: + paths-ignore: + - "*.md" + branches: + - main + +jobs: + generate-pot: + runs-on: ubuntu-latest + steps: + - name: "Checkout repo" + uses: actions/checkout@v3 + + - name: "Install gettext" + run: | + sudo apt update -qq + sudo apt install -y gettext + + - name: "Generate POT file using xgettext" + run: > + find src -name *.cpp -o -name *.hpp -o -name *.h | + xargs xgettext --from-code=utf-8 + -k_ -kwxTRANSLATE -w 100 + --check=space-ellipsis --omit-header + -o cemu.pot + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: POT file + path: ./cemu.pot + if-no-files-found: error \ No newline at end of file