Skip to content

Commit

Permalink
Merge pull request #1916 from tomudding/chore/script-cleanup
Browse files Browse the repository at this point in the history
chore: script cleanup
  • Loading branch information
tomudding authored Nov 9, 2024
2 parents a297a93 + 21da4d7 commit 5bb550e
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 59 deletions.
50 changes: 49 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ help:

.DEFAULT_GOAL := rundev

SHELL = /bin/bash
MODULE_DIR := ./module
LAST_WEB_COMMIT := $(shell git rev-parse --short HEAD)
SHELL := /bin/bash
TRANSLATIONS_DIR := $(MODULE_DIR)/Application/language/

runprod:
@docker compose -f docker-compose.yml up -d --remove-orphans
Expand Down Expand Up @@ -58,6 +60,9 @@ migration-down: replenish migration-list
@read -p "Enter the migration version to down (e.g., Application\\Migrations\\Version20241020212355 -- note escaping the backslashes is required): " version; \
docker compose exec -it web ./orm migrations:execute --down $$version

exec:
docker compose exec -it web $(cmd)

stop:
@docker compose down

Expand All @@ -83,6 +88,49 @@ replenish:
@docker compose exec web composer dump-autoload --dev
@docker compose exec web ./orm orm:generate-proxies

translations:
@find $(MODULE_DIR) -iname "*.phtml" -print0 | sort -z | xargs -r0 xgettext \
--language=PHP \
--from-code=UTF-8 \
--keyword=translate \
--keyword=translatePlural:1,2 \
--output=$(TRANSLATIONS_DIR)/gewisweb.pot \
--force-po \
--no-location \
--sort-output \
--package-name=GEWISweb \
--package-version=$(shell git describe --dirty --always) \
--copyright-holder=GEWIS && \
find $(MODULE_DIR) -iname "*.php" -print0 | sort -z | xargs -r0 xgettext \
--language=PHP \
--from-code=UTF-8 \
--keyword=translate \
--keyword=translatePlural:1,2 \
--output=$(TRANSLATIONS_DIR)/gewisweb.pot \
--force-po \
--no-location \
--sort-output \
--package-name=GEWISweb \
--package-version=$(shell git describe --dirty --always) \
--copyright-holder=GEWIS \
--join-existing && \
xgettext $(TRANSLATIONS_DIR)/additional-strings \
--language=C \
--from-code=UTF-8 \
--extract-all \
--output=$(TRANSLATIONS_DIR)/gewisweb.pot \
--force-po \
--no-location \
--sort-output \
--package-name=GEWISweb \
--package-version=$(shell git describe --dirty --always) \
--copyright-holder=GEWIS \
--join-existing && \
msgmerge --sort-output -U $(TRANSLATIONS_DIR)/nl.po $(TRANSLATIONS_DIR)/gewisweb.pot && \
msgmerge --sort-output -U $(TRANSLATIONS_DIR)/en.po $(TRANSLATIONS_DIR)/gewisweb.pot && \
msgattrib --no-obsolete -o $(TRANSLATIONS_DIR)/en.po $(TRANSLATIONS_DIR)/en.po && \
msgattrib --no-obsolete -o $(TRANSLATIONS_DIR)/nl.po $(TRANSLATIONS_DIR)/nl.po

update: updatecomposer updatepackage updatecss updateglide updatedocker

loadenv:
Expand Down
2 changes: 0 additions & 2 deletions dockerexec

This file was deleted.

56 changes: 0 additions & 56 deletions translate-helper

This file was deleted.

0 comments on commit 5bb550e

Please sign in to comment.