From 675c8475ee4b93d462e758d7e82e9941ed1f782e Mon Sep 17 00:00:00 2001 From: Pablo Saratxaga Date: Sat, 24 Aug 2002 01:22:19 +0000 Subject: Changed remaining gettext("foo $bar") into _("foo %s", $bar) Added russian man pages redo the way the *.pot file is created rebuild *.po files --- po/Makefile | 52 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 16 deletions(-) (limited to 'po/Makefile') diff --git a/po/Makefile b/po/Makefile index 91a7f125..a53e5ac4 100644 --- a/po/Makefile +++ b/po/Makefile @@ -1,14 +1,46 @@ # Installation directories localedir = $(PREFIX)/usr/share/locale -LANGS = $(shell ls *.po | xargs -i basename {} .po ) PGOAL = urpmi -GOALS = $(PGOAL).pot $(foreach a, $(LANGS), $(a).mo) -POTFILES = $(shell sed -e "s+^+../+" "POTFILES.in" ) + +# perl files to search translatable strings in +PL_FILES = ../_irpm ../urpm.pm ../urpme ../urpmi ../urpmi.addmedia \ + ../urpmi.removemedia ../urpmi.update ../urpmq +# C-like files to search translatable strings in +CFILES = ./placeholder.h + +PL_CFILES = $(PL_FILES:%=%_.c) +POFILES = $(shell ls *.po) +MOFILES = $(POFILES:%.po=%.mo) +LANGS = $(POFILES:%.po=%) + +GOALS = $(PGOAL).pot $(MOFILES) all: $(GOALS) +%.mo: %.po + msgfmt -o $@ $< + +$(PL_CFILES): %_.c: % + ./fake_c.pl $< > $@ + +merge: $(PGOAL).pot + @for n in $(POFILES); do \ + echo "Merging $$n"; \ + msgmerge "$$n" $< > "$$n"t; \ + mv -f "$$n"t "$$n"; \ + done + +$(PGOAL).pot: $(PL_CFILES) $(CFILES) + ./create_placeholder + xgettext --default-domain=$(PGOAL) -F -n \ + --add-comments='-PO' --add-comments=' Translator:'\ + --keyword=_ --keyword=__ --keyword=N_ --keyword=gettext \ + --language=C $(PL_CFILES) $(CFILES) + mv -f $(PGOAL).po $(PGOAL).pot + @rm -rf $(PL_CFILES) + install: all for l in $(LANGS); do \ install -d $(localedir)/$$l/LC_MESSAGES; \ @@ -16,18 +48,6 @@ install: all done clean: - rm -f *~ *.[oas] *.mo $(GOALS) TAGS - -%.h: - @touch $@ - -%.mo: %.po - msgfmt -o $@ $< + @rm -rf *~ *.mo $(GOALS) $(PL_CFILES) -%.pot: $(POTFILES) - ./create_placeholder $(POTFILES) - xgettext --default-domain=`basename $@ .pot` --add-comments \ - --keyword=__ --keyword=_ --keyword=N_ --keyword=gettext \ - placeholder.h && \ - mv `basename $@ .pot`.po $@ -- cgit v1.2.1