From 6cab5f5099c0f6f236b0d9809a8571149c54b335 Mon Sep 17 00:00:00 2001 From: dairiki Date: Sat, 7 Apr 2001 17:07:17 +0000 Subject: [PATCH] New file: locale/Makefile to replace locale/translate.sh git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@482 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- locale/Makefile | 39 ++++++++++++++++++++++++++++++++++++ locale/make-php-trans.awk | 42 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 locale/Makefile create mode 100644 locale/make-php-trans.awk diff --git a/locale/Makefile b/locale/Makefile new file mode 100644 index 000000000..5464307a8 --- /dev/null +++ b/locale/Makefile @@ -0,0 +1,39 @@ +# $Id: Makefile,v 1.1 2001-04-07 17:07:17 dairiki Exp $ +# +# locale/Makefile +# +# This is a replacement for locale/translate.sh to avoid remaking files that +# don't need to be remade. +# + +ALL_LINGUAS = nl es de sv + +PO_FILES = $(patsubst %, po/%.po, ${ALL_LINGUAS}) +MO_FILES = $(patsubst %, %/LC_MESSAGES/phpwiki.mo, ${ALL_LINGUAS}) +PHP_FILES = ${MO_FILES:.mo=.php} + +PHP_SRC := $(wildcard ../lib/*.php ../admin/*.php) + +.PHONY: all po mo + +all : po mo +po : ${PO_FILES} +mo : ${MO_FILES} ${PHP_FILES} + +po/phpwiki.pot : ${PHP_SRC} + xgettext -L C++ -o $@ $^ + +po/%.po : po/phpwiki.pot + test -f $@ || touch $@ + mv -f $@ $@~ + msgmerge -o $@ $@~ $^ + +%/LC_MESSAGES/phpwiki.mo : po/%.po + mkdir -p $*/LC_MESSAGES + msgfmt -o $@ $< + +# Generate .php from .mo rather than .po to maximize +# the probability of agreement between .mo and .php files. +%/LC_MESSAGES/phpwiki.php : %/LC_MESSAGES/phpwiki.mo + msgunfmt $< | awk -f make-php-trans.awk > $@ + diff --git a/locale/make-php-trans.awk b/locale/make-php-trans.awk new file mode 100644 index 000000000..6587947b3 --- /dev/null +++ b/locale/make-php-trans.awk @@ -0,0 +1,42 @@ +BEGIN { + msgid=""; msgstr=""; + print (""); +} + -- 2.45.2