2016-11-14 03:27:15 -06:00
|
|
|
# Auxiliary target for translation maintainer:
|
|
|
|
# Strip untranslated strings and comments with code lines from the po files
|
|
|
|
# to make them smaller before storage in SCM.
|
|
|
|
|
|
|
|
DISTFILES.common.extra3 = Makefile.hack.in
|
|
|
|
|
2016-11-15 09:43:58 -06:00
|
|
|
IPA_TEST_I18N = @top_srcdir@/ipatests/i18n.py
|
2016-11-14 03:27:15 -06:00
|
|
|
MSGATTRIB = @MSGATTRIB@
|
|
|
|
|
|
|
|
.PHONY: strip-po
|
|
|
|
strip-po:
|
|
|
|
for po_file in $(POFILES); do \
|
|
|
|
$(MSGATTRIB) --translated --no-fuzzy --no-location $$po_file > $$po_file.tmp || exit 1; \
|
|
|
|
mv $$po_file.tmp $$po_file || exit 1; \
|
|
|
|
done
|
|
|
|
export FILES_TO_REMOVE=`find $(srcdir) -name '*.po' -empty` || exit 1; \
|
|
|
|
if [ "$$FILES_TO_REMOVE" != "" ]; then \
|
|
|
|
rm -v $$FILES_TO_REMOVE || exit 1; \
|
|
|
|
echo; echo Please remove the deleted files from LINGUAS!; echo; \
|
|
|
|
fi
|
|
|
|
|
2016-11-14 03:48:18 -06:00
|
|
|
clean: mostlyclean
|
|
|
|
rm -f *~
|
2016-11-15 09:43:58 -06:00
|
|
|
|
|
|
|
# linters
|
|
|
|
test-gettext: $(DOMAIN).pot
|
|
|
|
$(IPA_TEST_I18N) --test-gettext
|
|
|
|
|
2016-11-24 08:20:39 -06:00
|
|
|
validate-pot: $(DOMAIN).pot
|
2016-11-15 09:43:58 -06:00
|
|
|
$(IPA_TEST_I18N) --show-strings --validate-pot $(DOMAIN).pot
|
|
|
|
|
2016-11-24 08:20:39 -06:00
|
|
|
validate-po: $(DOMAIN).pot
|
2016-11-15 09:43:58 -06:00
|
|
|
$(IPA_TEST_I18N) --show-strings --validate-po $(POFILES)
|
|
|
|
|
|
|
|
# forcefully re-generate .pot file and test it
|
|
|
|
validate-src-strings: $(DOMAIN).pot-update
|
|
|
|
$(MAKE) validate-pot
|