X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/1372a4a4c205960e1e89ea64a80fa0950815db77..f814fbf4f2c78e3b9ceeeaba3cb93ed0ebbc7943:/po/makefile diff --git a/po/makefile b/po/makefile index a3d9d2d8f..07dc51c07 100644 --- a/po/makefile +++ b/po/makefile @@ -40,15 +40,18 @@ $(POTFILES) : $(PO)/%.pot : --files-from=$(PO)/POTFILES_$*.in -o $(PO)/domains/$*/c.pot rm -f $(PO)/POTFILES_$*.in $(MSGCOMM) --more-than=0 $(PO)/domains/$*/c.pot $(PO)/domains/$*/sh.pot --output=$@ + # copy into the domain dirs to make rosetta happy + rm -f $(PO)/domains/$*/*.pot + cp $@ $(PO)/domains/$* -$(PO)/$(PACKAGE)-all.pot: $(POTFILES) +$(PACKAGE)-all.pot: $(POTFILES) $(MSGCOMM) --more-than=0 $(POTFILES) --output=$@ # Filter the complete translation with the domain specific file to produce # only the subtext needed for this domain # We cannot express the dependencies required for this directly with a pattern # rule, so we use the .d hack. -$(LANG_POFILES) : $(PO_DOMAINS)/%.po : $(PO)/$(PACKAGE)-all.pot +$(LANG_POFILES) : $(PO_DOMAINS)/%.po : $(PACKAGE)-all.pot printf "%s " "Generating $@" echo $@ : $(notdir $@) $(PO)/$(call GETDOMAIN,$*).pot > $(PO)/$(call GETDOMAIN,$*)_$(notdir $@).d $(MSGMERGE) $(notdir $@) $(PO)/$(call GETDOMAIN,$*).pot -o $@ @@ -60,12 +63,21 @@ $(MOFILES) : $(PO_DOMAINS)/%.mo : $(PO_DOMAINS)/%.po cp $@ $(LOCALE)/$(notdir $*)/LC_MESSAGES/$(call GETDOMAIN,$*).mo stats: - for i in *.po; do echo -n "$$i: "; msgfmt --statistics $$i; done + for i in *.pot *.po; do echo -n "$$i: "; msgfmt --statistics $$i; done -binary: $(POTFILES) $(PO)/$(PACKAGE)-all.pot $(MOFILES) +binary: $(POTFILES) $(PACKAGE)-all.pot $(MOFILES) + +.PHONY: update-po +update-po: $(PACKAGE)-all.pot + for lang in ${LINGUAS}; do \ + echo "Updating $$lang.po"; \ + $(MSGMERGE) $$lang.po $(PACKAGE)-all.pot -o $$lang.new.po; \ + cmp $$lang.new.po $$lang.po || cp $$lang.new.po $$lang.po; \ + rm -f $$lang.new.po; \ + done clean: clean/local -clean/local: +clean/local: update-po rm -f $(MOFILES) $(LANG_POFILES) $(PO)/*.d # Include the dependencies that are available