mirror of
https://github.com/vcmi/vcmi.git
synced 2026-06-19 22:57:37 +02:00
62 lines
1.8 KiB
YAML
62 lines
1.8 KiB
YAML
name: Weekly translation refresh
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 0 * * 0' # Runs every Sunday at 00:00 UTC
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
refresh:
|
|
name: Refresh Translations
|
|
runs-on: ubuntu-latest
|
|
if: github.repository == 'vcmi/vcmi'
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
with:
|
|
ref: ${{ github.ref_name }}
|
|
fetch-depth: 0
|
|
submodules: false
|
|
|
|
- name: Install localization tools (lupdate & gettext)
|
|
run: |
|
|
sudo apt-get update && sudo apt install -y --no-install-recommends qttools5-dev-tools gettext
|
|
|
|
- name: Update gettext files
|
|
working-directory: launcher
|
|
run: |
|
|
xgettext eu.vcmi.VCMI.metainfo.xml vcmilauncher.desktop -o po/VCMI.pot --copyright-holder="VCMI Team" --package-name="VCMI"
|
|
for file in po/*.po; do
|
|
msgmerge --update "$file" po/VCMI.pot
|
|
done
|
|
|
|
- name: Update TS files (Launcher)
|
|
working-directory: launcher
|
|
run: |
|
|
lupdate . -ts translation/*.ts
|
|
|
|
- name: Update TS files (Map Editor)
|
|
working-directory: mapeditor
|
|
run: |
|
|
lupdate . -ts translation/*.ts
|
|
|
|
- name: Create Pull Request
|
|
uses: peter-evans/create-pull-request@v8
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
branch: bot/qt-translation-refresh/${{ github.ref_name }}
|
|
base: ${{ github.ref_name }}
|
|
commit-message: "Auto-update VCMI Qt translation files"
|
|
title: "Auto-update Qt translation files"
|
|
body: |
|
|
This PR updates Qt translation `.ts` files generated by `lupdate`.
|
|
add-paths: |
|
|
launcher/translation/*.ts
|
|
mapeditor/translation/*.ts
|
|
delete-branch: true
|