From d22f36b1528465e6098fd7422852a3f06b3c678c Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 27 Jan 2009 17:30:19 +0000 Subject: enhance po Makefile - wrapper around po2text to handle fuzzy strings - add update_n_merge and merge rules to help update the po files --- po/Makefile | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/po/Makefile b/po/Makefile index b120b47..57ead20 100644 --- a/po/Makefile +++ b/po/Makefile @@ -8,8 +8,14 @@ all: .ready .ready: text.inc $(TEXTS) @touch .ready +# the po2txt script requires that the po file has no fuzzy entries +# and the same comments as the pot file; so we do a msgfmt/msgunfmt/msgmerge +# to ensure that %.tr: %.po text.inc - bin/po2txt --product='$(PRODUCT)' $< >$@ + msgfmt $< -o - | msgunfmt | \ + msgmerge --no-fuzzy-matching - bootloader.pot > tmpfile.po && \ + bin/po2txt --product='$(PRODUCT)' tmpfile.po >$@ + echo rm -f tmpfile.po # en.tr uses msgids from bootloader.pot en.tr text.inc: bootloader.pot @@ -17,3 +23,13 @@ en.tr text.inc: bootloader.pot clean: rm -f .ready text.inc *.tr *~ talk/*~ + + +update_n_merge: bootloader.pot merge + +merge: + for n in *.po; do \ + echo "Merging $$n"; \ + msgmerge -C $$n $$n bootloader.pot > "$$n"t ; \ + mv -f "$$n"t $$n ; \ + done -- cgit v1.2.1