2021-10-15 00:23:45 +02:00
|
|
|
.PHONY: .locale-update build
|
2021-10-17 00:20:03 +02:00
|
|
|
.ONESHELL:
|
|
|
|
|
|
|
|
all: clean build
|
2021-10-15 00:23:45 +02:00
|
|
|
|
|
|
|
SHELL = bash
|
|
|
|
|
|
|
|
DOMAIN = libretime
|
2022-03-29 13:07:38 +02:00
|
|
|
ISSUE_TRACKER = https://github.com/libretime/libretime/issues
|
2021-10-15 00:23:45 +02:00
|
|
|
PO_FILE = $(DOMAIN).po
|
|
|
|
PO_FILES = $(wildcard */LC_MESSAGES/$(PO_FILE))
|
|
|
|
MO_FILES = $(PO_FILES:.po=.mo)
|
|
|
|
|
|
|
|
SRC = application build public
|
|
|
|
|
|
|
|
XGETTEXT_ARGS = --default-domain=$(DOMAIN) \
|
2021-10-17 00:20:03 +02:00
|
|
|
--msgid-bugs-address=$(ISSUE_TRACKER) \
|
2021-10-15 00:23:45 +02:00
|
|
|
--language=php \
|
|
|
|
--from-code=UTF-8 \
|
|
|
|
--no-wrap \
|
|
|
|
--sort-by-file
|
|
|
|
|
|
|
|
MSGMERGE_ARGS = --no-fuzzy-matching \
|
|
|
|
--update \
|
|
|
|
--no-wrap \
|
|
|
|
--sort-by-file
|
|
|
|
|
2021-10-17 00:20:03 +02:00
|
|
|
update:
|
|
|
|
cd ..
|
2021-10-15 00:23:45 +02:00
|
|
|
find $(SRC) -name "*.phtml" -o -name "*.php" -type f -print0 | xargs -0 xgettext $(XGETTEXT_ARGS)
|
|
|
|
sed -i 's/CHARSET/UTF-8/g' $(PO_FILE)
|
|
|
|
find ./locale -name $(PO_FILE) -exec msgmerge $(MSGMERGE_ARGS) "{}" $(PO_FILE) \;
|
|
|
|
rm $(PO_FILE)
|
|
|
|
|
|
|
|
%.mo: %.po
|
|
|
|
msgfmt $< -o $@
|
|
|
|
|
|
|
|
build: $(MO_FILES)
|
2021-10-17 00:20:03 +02:00
|
|
|
|
|
|
|
clean:
|
2022-02-25 19:16:41 +01:00
|
|
|
@rm -f $(MO_FILES)
|