mirror of
https://github.com/izzy2lost/WeeU.git
synced 2026-03-26 18:15:50 -07:00
56 lines
1.3 KiB
YAML
56 lines
1.3 KiB
YAML
name: Generate translation template
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
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@v4
|
|
|
|
- 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 -w 100
|
|
--keyword="_" --keyword="wxTRANSLATE" --keyword="wxPLURAL:1,2"
|
|
--keyword="_tr" --keyword="TR_NOOP"
|
|
--check=space-ellipsis --omit-header
|
|
-o cemu_cpp.pot
|
|
|
|
- name: "Generate POT file from the Android App"
|
|
run: |
|
|
cemu_dir=$(pwd)
|
|
cd src/android/app
|
|
./gradlew gettext
|
|
mv cemu_kt.pot "$cemu_dir"
|
|
|
|
- name: "Combine the POT files"
|
|
run: |
|
|
xgettext cemu_cpp.pot cemu_kt.pot --omit-header -o cemu.pot
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: POT file
|
|
path: ./cemu.pot
|
|
if-no-files-found: error
|