mirror of
https://github.com/koreader/koreader.git
synced 2026-11-28 00:04:23 +00:00
38 lines
884 B
Makefile
38 lines
884 B
Makefile
PHONY += mo mo-clean po pot
|
|
|
|
SELF := $(lastword $(MAKEFILE_LIST))
|
|
|
|
DOMAIN = koreader
|
|
TEMPLATE_DIR = l10n/templates
|
|
MSGFMT_BIN = msgfmt
|
|
XGETTEXT_BIN = xgettext
|
|
|
|
PO_FILES = $(wildcard l10n/*/*.po)
|
|
MO_FILES = $(PO_FILES:%.po=%.mo)
|
|
|
|
%.mo: %.po
|
|
@$(MSGFMT_BIN) --no-hash -o $@ $<
|
|
|
|
mo:
|
|
ifneq (,$(MO_FILES))
|
|
$(MAKE) $(if $(PARALLEL_JOBS),--jobs=$(PARALLEL_JOBS)) $(if $(PARALLEL_LOAD),--load-average=$(PARALLEL_LOAD)) --silent --file=$(SELF) $(MO_FILES)
|
|
endif
|
|
|
|
mo-clean:
|
|
ifneq (,$(MO_FILES))
|
|
rm -f $(MO_FILES)
|
|
endif
|
|
|
|
pot: po
|
|
mkdir -p $(TEMPLATE_DIR)
|
|
$(XGETTEXT_BIN) --from-code=utf-8 \
|
|
--keyword=C_:1c,2 --keyword=N_:1,2 --keyword=NC_:1c,2,3 \
|
|
--add-comments=@translators \
|
|
reader.lua `find frontend -iname "*.lua" | sort` \
|
|
`find plugins -iname "*.lua" | sort` \
|
|
`find tools -iname "*.lua" | sort` \
|
|
-o $(TEMPLATE_DIR)/$(DOMAIN).pot
|
|
|
|
po:
|
|
git submodule update --remote l10n
|