From e58875f801fa0703cef9138df2ed456b34462969 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 23 Jul 2001 18:48:32 +0000 Subject: do not use the po's directly. Use mo's through gettext --- perl-install/share/po/Makefile | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) (limited to 'perl-install/share/po/Makefile') diff --git a/perl-install/share/po/Makefile b/perl-install/share/po/Makefile index 1e2f640ce..43b32542a 100644 --- a/perl-install/share/po/Makefile +++ b/perl-install/share/po/Makefile @@ -2,17 +2,21 @@ include ../../Makefile.config PMSFILES = $(wildcard $(PMS:%=../../%)) PMSCFILES = $(PMSFILES:%=%_.c) + POFILES = $(shell ls *.po) -PERL2C = +MOFILES = $(POFILES:%.po=%.mo) +LANGS = $(POFILES:%.po=%) -all: $(POFILES) +LOCALEDIR=$(DATADIR)/locale -clean: - rm -f empty.po tmp.* messages tmp.pot $(POFILES:%=%t) $(PMSCFILES) -verif: - perl -ne '/^\s*#/ or $$i += my @l = /\b__?\(/g; END { print "$$i\n" }' $(PMSFILES) - perl -ne '$$i += my @l = /\.c:/g; END { print "$$i\n" }' DrakX.pot +all: $(MOFILES) + +%.mo: %.po + msgfmt -o $@ $< + +$(PMSCFILES): %_.c: % + ./fake_c.pl $< > $@ $(POFILES): DrakX.pot cp -f $@ $@t @@ -25,6 +29,19 @@ DrakX.pot: $(PMSFILES) rm $(PMSCFILES) perl i18n_compssUsers 2>/dev/null >> $@ +install: + for l in $(LANGS); do \ + install -d $(LOCALEDIR)/$$l/LC_MESSAGES; \ + install -m 644 $$l.mo $(LOCALEDIR)/$$l/LC_MESSAGES/$(NAME).mo; \ + done + +clean: + rm -f empty.po tmp.* messages tmp.pot *.mo $(POFILES:%=%t) $(PMSCFILES) + +verif: + perl -ne '/^\s*#/ or $$i += my @l = /\b__?\(/g; END { print "$$i\n" }' $(PMSFILES) + perl -ne '$$i += my @l = /\.c:/g; END { print "$$i\n" }' DrakX.pot + verif2: # perl -I ../.. -Mcommon -e 'foreach (qw($(PMSFILES))) { printf "package foo%d;\n", ++$$i; print common::cat_($$_) }' | perl -ne 'print if !/use (diagnostics|vars|strict)/' | OUTFILE=tmp.pm perl -I. -I../.. -Mb_dump_strings >/dev/null 2>/dev/null perl -pe 's|$$|\\n\\|' tmp.pm > tmp.pm_.c @@ -33,7 +50,5 @@ verif2: grep "^msgid" tmp.pot | sort > tmp.pot.light grep "^msgid" DrakX.pot | sort | diff - tmp.pot.light | grep "^>" || true -$(PMSCFILES): %_.c: % - ./fake_c.pl $< > $@ # for i in *.po; do echo -n "$i "; msgfmt -v $i 2>&1; done | perl -e 'print map { $_->[0] } sort { $a->[1] <=> $b->[1] } map { [ $_, (split)[1] ] } <>' -- cgit v1.2.1