mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-18 13:03:58 +01:00
gettext.mk: Try to re-organize workflow
Try to make the workflow a little more versatile. As of this commit, .pot files are assumed to preexist, save $(GETTEXT_PROJECT_POT), which can be generated from source, and should be committed, too. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
a64cd918dd
commit
39a558d3a1
1 changed files with 12 additions and 2 deletions
|
|
@ -7,8 +7,8 @@ include $(JWBDIR)/make/dev-utils.mk
|
||||||
GETTEXT_PROJECT_PO ?= $(PROJECT).po
|
GETTEXT_PROJECT_PO ?= $(PROJECT).po
|
||||||
GETTEXT_PROJECT_POT ?= $(PROJECT).pot
|
GETTEXT_PROJECT_POT ?= $(PROJECT).pot
|
||||||
|
|
||||||
GETTEXT_PO ?= $(wildcard *.po)
|
GETTEXT_POT ?= $(wildcard *.pot)
|
||||||
GETTEXT_POT ?= $(patsubst %.po,%.pot,$(GETTEXT_PO))
|
GETTEXT_PO ?= $(patsubst %.pot,%.po,$(GETTEXT_POT))
|
||||||
GETTEXT_MO ?= $(patsubst %.po,%.mo,$(GETTEXT_PO))
|
GETTEXT_MO ?= $(patsubst %.po,%.mo,$(GETTEXT_PO))
|
||||||
GETTEXT_INPUT_DIRS ?= $(wildcard $(TOPDIR)/tools $(TOPDIR)/src $(TOPDIR)/conf)
|
GETTEXT_INPUT_DIRS ?= $(wildcard $(TOPDIR)/tools $(TOPDIR)/src $(TOPDIR)/conf)
|
||||||
GETTEXT_INPUT_FILES ?= $(foreach d,$(GETTEXT_INPUT_DIRS),\
|
GETTEXT_INPUT_FILES ?= $(foreach d,$(GETTEXT_INPUT_DIRS),\
|
||||||
|
|
@ -21,6 +21,7 @@ clean: clean-mo
|
||||||
$(RM) -rf *~ .*.swp
|
$(RM) -rf *~ .*.swp
|
||||||
install: install_MO
|
install: install_MO
|
||||||
distclean: clean
|
distclean: clean
|
||||||
|
test:
|
||||||
|
|
||||||
extract: $(GETTEXT_POT)
|
extract: $(GETTEXT_POT)
|
||||||
clean-mo:
|
clean-mo:
|
||||||
|
|
@ -43,6 +44,15 @@ merge: $(GETTEXT_PROJECT_POT)
|
||||||
$(wildcard $(GETTEXT_PROJECT_PO)) $<
|
$(wildcard $(GETTEXT_PROJECT_PO)) $<
|
||||||
mv $(GETTEXT_PROJECT_PO).tmp $(GETTEXT_PROJECT_PO)
|
mv $(GETTEXT_PROJECT_PO).tmp $(GETTEXT_PROJECT_PO)
|
||||||
|
|
||||||
|
merge-pot: $(GETTEXT_POT)
|
||||||
|
msgmerge -v --lang $(GETTEXT_LOCALE) --output-file $(GETTEXT_PROJECT_PO).tmp \
|
||||||
|
$(wildcard $(GETTEXT_PROJECT_PO)) $<
|
||||||
|
mv $(GETTEXT_PROJECT_PO).tmp $(GETTEXT_PROJECT_PO)
|
||||||
|
|
||||||
|
$(GETTEXT_PROJECT_PO): $(GETTEXT_POT)
|
||||||
|
msgcat --lang $(GETTEXT_LOCALE) --output-file $@.tmp $^
|
||||||
|
mv $@.tmp $@
|
||||||
|
|
||||||
edit: merge $(GETTEXT_PROJECT_POT)
|
edit: merge $(GETTEXT_PROJECT_POT)
|
||||||
poedit $(GETTEXT_PROJECT_PO)
|
poedit $(GETTEXT_PROJECT_PO)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue