diff --git a/.github/workflows/legacy.yml b/.github/workflows/legacy.yml index 4e607c14c..1e3e18f45 100644 --- a/.github/workflows/legacy.yml +++ b/.github/workflows/legacy.yml @@ -83,3 +83,28 @@ jobs: - name: Run tests run: make test working-directory: legacy + + locale: + runs-on: ubuntu-latest + + if: github.event_name == 'schedule' + 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 + + - name: Update locales + run: | + make -C legacy/locale update + + git config --global user.name "libretime-bot" + git config --global user.email "libretime-bot@users.noreply.github.com" + + git add legacy/locale + git diff-index --quiet HEAD -- legacy/locale || { + git commit --message "chore(legacy): update locales" + git push + } diff --git a/.github/workflows/project.yml b/.github/workflows/project.yml index c057e7e23..2e4436149 100644 --- a/.github/workflows/project.yml +++ b/.github/workflows/project.yml @@ -16,11 +16,6 @@ jobs: 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" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dd1f30a45..0cbb2afcf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -104,12 +104,3 @@ 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 diff --git a/legacy/locale/Makefile b/legacy/locale/Makefile index fbd0ac9a2..13a33033d 100644 --- a/legacy/locale/Makefile +++ b/legacy/locale/Makefile @@ -32,15 +32,6 @@ 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 $@