ci: check if locale are up to date

This commit is contained in:
jo 2023-02-24 13:38:21 +01:00 committed by Kyle Robbertze
parent dea3d1a297
commit 53673632df
3 changed files with 24 additions and 0 deletions

View File

@ -15,6 +15,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
DEBIAN_FRONTEND=noninteractive sudo apt-get update
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y gettext
- uses: actions/setup-python@v4
with:
python-version: "3.x"

View File

@ -104,3 +104,12 @@ repos:
pass_filenames: false
language: script
files: ^legacy
- id: legacy-locale-update
name: legacy-locale-update
description: Update legacy locale
entry: make
args: [-C, legacy/locale, check-update]
pass_filenames: false
language: system
files: ^legacy

View File

@ -32,6 +32,15 @@ update:
find ./locale -name $(PO_FILE) -exec msgmerge $(MSGMERGE_ARGS) "{}" $(PO_FILE) \;
rm $(PO_FILE)
update-foreach-commit:
git rebase main -x "$(MAKE) -C legacy/locale update"
check-update: update
if git status --porcelain -- */LC_MESSAGES/$(PO_FILE) | grep -q '^ M'; then \
git --no-pager diff -- */LC_MESSAGES/$(PO_FILE); \
exit 1; \
fi
%.mo: %.po
msgfmt $< -o $@