* Makefile creates/updates po/davadmin.pot, .po, and .mo files
 * admin/i18n.inc.php sets the locale and puts it in the session
 * admin/common.inc.php and admin/getgroups.php use admin/i18n.inc.php
 * po/pot.sed replaces generated header of po/davadmin.pot
This commit is contained in:
Jan Dittberner 2007-11-30 21:25:52 +00:00
parent 83251502e9
commit a978fb5ef0
6 changed files with 344 additions and 14 deletions

View file

@ -23,21 +23,71 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA.
VERSION := 0.2
PROJECT := davadmin
SRCFILES := $(wildcard admin/*.php)
APISRC := $(SRCFILES:,= )
TEMPDIR := $(shell mktemp -t -d davadmin.XXXXXXXXXX)
XSRCFILES := $(patsubst %,$(TEMPDIR)/%,$(SRCFILES))
TRANSLANG := de
POSRC := po
POFILES := $(foreach lang,$(TRANSLANG),$(POSRC)/$(lang).po)
MOFILES := $(patsubst %.po,%.mo,$(POFILES))
POT=$(POSRC)/$(PROJECT).pot
.PHONY: all
all: $(POT) $(MOFILES) $(TEMPDIR)/delete
$(MOFILES): %.mo: %.po
@echo "msgfmt: $@"
msgfmt -o$@ $<
$(POFILES): %: $(POT)
@echo "msgmerge: $@"
msgmerge -U $@ $(POT)
touch $@
$(POT): $(XSRCFILES) po/pot.sed
@echo "xgettext: $@"
cd $(TEMPDIR) && \
xgettext --default-domain=$(PROJECT) --language=php \
--from-code=UTF-8 \
--msgid-bugs-address="jan@dittberner.info" -o- $(SRCFILES) \
| sed -f $(CURDIR)/po/pot.sed \
> $(CURDIR)/$@
for pofile in $(POFILES); do \
if test ! -f $(CURDIR)/$${pofile}; then \
cp $(CURDIR)/$@ $(CURDIR)/$${pofile}; \
fi; \
done
.INTERMEDIATE: $(XSRCFILES)
$(XSRCFILES): $(TEMPDIR)/%: %
@echo "processing: $<"
mkdir -p $(@D)
cp $< $@
$(TEMPDIR)/delete:
rm -rf $(TEMPDIR)
.PHONY: apidoc
VERSION=0.2
PROJECT=webdavadmin
SRCFILES=admin/common.inc.php,admin/directories.php,admin/getgroups.php,admin/index.php,admin/users.php
apidoc:
if [ -d apidoc ]; then rm -r apidoc; fi
phpdoc -f $(SRCFILES) -t apidoc --undocumentedelements on -s
phpdoc -f $(APISRC) -t apidoc --undocumentedelements on -s
clean:
.PHONY: clean distclean
clean: $(TEMPDIR)/delete
find -name '*~' -type f -exec rm {} \;
distclean: clean
if [ -d apidoc ]; then rm -r apidoc; fi
RELPREFIX := $(PROJECT)-$(VERSION)
dist: distclean
cd .. ; tar czf $(PROJECT)-$(VERSION).tar.gz $(PROJECT)-$(VERSION)
cd .. ; if test ! -d $(RELPREFIX); then \
ln -s trunk $(RELPREFIX)-dev; \
tar czh --exclude=.svn -f $(RELPREFIX)-dev.tar.gz $(RELPREFIX)-dev; \
rm -f $(RELPREFIX)-dev; \
else \
tar czhf $(PROJECT)-$(VERSION).tar.gz $(PROJECT)-$(VERSION); \
fi