note 10081 added to GNU Gettext
| From: | alex at dentonlive dot com | Date: | Tue, 12 Dec 2000 12:32:02 +0000 |
| Subject: | note 10081 added to GNU Gettext | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-8644@lists.php.net to get a copy of this message | ||
Here is a generic makefile for php
gettext ... please understand you will need xgettext and msgfmt and vi (could be replaced with any
text editor) in order to make it work. Thanks
#
# makefile for php gettext converter.
# By Alex Lau all right reserved.
# use as your own risk
# any question please contect alex@dentonlive.com
VERSION = 1.0 # code version
CC = xgettext
CFLAGS = -a -o
GCC= msgfmt
GFLAGS= -o
MO = test
MOPATH= ./
POT_OBJS= $(patsubst %.php,%.pot,$(wildcard *.php))
GMO_OBJS= $(patsubst %.pot,%.gmo,$(wildcard *.pot))
ALL_OBJS = $(POT_OBJS) $(GMO_OBJS)
all : pot_make gmo_make $(MO)
pot_make: $(POT_OBJS)
gmo_make: $(GMO_OBJS)
$(MO) : $(ALL_OBJS)
cp $@.gmo $(MOPATH)$(MO).mo
%.pot : %.php
cp $(*F).php $(*F).c
$(CC) $(CFLAGS) $@ $(*F).c
vi $@
rm $(*F).c
%.gmo : %.pot
$(GCC) $(GFLAGS) $@ $(*F).pot
clean:
rm -rf *.c *.gmo *.pot $(MO).mo
http://www.php.net/manual/ref.gettext.php