Mercurial > p > roundup > code
comparison locale/GNUmakefile @ 6609:b6452b669720
Updates, python3, hg diff, add target doc, add pytest target
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Fri, 28 Jan 2022 20:11:32 -0500 |
| parents | 9730eff21de3 |
| children | ebd8f962fbf1 |
comparison
equal
deleted
inserted
replaced
| 6608:215031280074 | 6609:b6452b669720 |
|---|---|
| 4 # tool locations | 4 # tool locations |
| 5 XPOT ?= xpot | 5 XPOT ?= xpot |
| 6 MSGFMT ?= msgfmt | 6 MSGFMT ?= msgfmt |
| 7 MSGMERGE ?= msgmerge | 7 MSGMERGE ?= msgmerge |
| 8 XGETTEXT ?= xgettext | 8 XGETTEXT ?= xgettext |
| 9 PYTHON ?= python | 9 PYTHON ?= python3 |
| 10 | 10 |
| 11 TEMPLATE=roundup.pot | 11 TEMPLATE=roundup.pot |
| 12 | 12 |
| 13 PACKAGES=$(shell find ../roundup ../share/roundup/templates -name '*.py' \ | 13 PACKAGES=$(shell find ../roundup ../share/roundup/templates -name '*.py' \ |
| 14 | sed -e 's,/[^/]*$$,,' | sort | uniq) | 14 | sed -e 's,/[^/]*$$,,' | sort | uniq) |
| 20 | 20 |
| 21 all: dist | 21 all: dist |
| 22 | 22 |
| 23 help: | 23 help: |
| 24 @echo "$(MAKE) - build MO files. Run this before sdist" | 24 @echo "$(MAKE) - build MO files. Run this before sdist" |
| 25 @echo "$(MAKE) dist - same as above | |
| 25 @echo "$(MAKE) template - update message template from sources" | 26 @echo "$(MAKE) template - update message template from sources" |
| 27 @echo "$(MAKE) diff - see template differences in vi" | |
| 28 @echo "$(MAKE) pytest - create locale files to run pytest | |
| 26 @echo "$(MAKE) locale.po - update message file from template" | 29 @echo "$(MAKE) locale.po - update message file from template" |
| 27 @echo "$(MAKE) locale.mo - compile individual message file" | 30 @echo "$(MAKE) locale.mo - compile individual message file" |
| 28 @echo "$(MAKE) help - this text"\ | 31 @echo "$(MAKE) help - this text"\ |
| 29 | 32 |
| 30 # This will rebuild all MO files without updating their corresponding PO | 33 # This will rebuild all MO files without updating their corresponding PO |
| 35 for file in $(PO_FILES); do \ | 38 for file in $(PO_FILES); do \ |
| 36 ${MSGFMT} -o `basename $$file .po`.mo $$file; \ | 39 ${MSGFMT} -o `basename $$file .po`.mo $$file; \ |
| 37 done | 40 done |
| 38 | 41 |
| 39 template: | 42 template: |
| 40 test -d $(PYTHON_BUILD) || (echo "Missing build directory. ln -s lib to build library"; exit 1) | 43 test -d $(PYTHON_BUILD) || (echo "Missing build directory $(PYTHON_BUILD). ln -s lib to build library"; exit 1) |
| 41 ${XPOT} -n -o $(TEMPLATE) $(SOURCES) | 44 ${XPOT} -n -o $(TEMPLATE) $(SOURCES) |
| 42 | 45 |
| 43 ${RUN_PYTHON} ../roundup/cgi/TAL/talgettext.py -u $(TEMPLATE) \ | 46 ${RUN_PYTHON} ../roundup/cgi/TAL/talgettext.py -u $(TEMPLATE) \ |
| 44 ../share/roundup/templates/classic/html/*.html \ | 47 ../share/roundup/templates/classic/html/*.html \ |
| 45 ../share/roundup/templates/devel/html/*.html \ | 48 ../share/roundup/templates/devel/html/*.html \ |
| 48 ${XGETTEXT} -j -w 80 -F \ | 51 ${XGETTEXT} -j -w 80 -F \ |
| 49 --msgid-bugs-address=roundup-devel@lists.sourceforge.net \ | 52 --msgid-bugs-address=roundup-devel@lists.sourceforge.net \ |
| 50 --copyright-holder="See Roundup README.txt" \ | 53 --copyright-holder="See Roundup README.txt" \ |
| 51 -o $(TEMPLATE) $(SOURCES) | 54 -o $(TEMPLATE) $(SOURCES) |
| 52 | 55 |
| 53 local_install: dist | 56 pytest local_install: dist |
| 54 for file in $(MO_FILES); do \ | 57 for file in $(MO_FILES); do \ |
| 55 lang=`basename $$file .mo`; \ | 58 lang=`basename $$file .mo`; \ |
| 56 mkdir -p locale/$$lang/LC_MESSAGES; \ | 59 mkdir -p locale/$$lang/LC_MESSAGES; \ |
| 57 cp $$file locale/$$lang/LC_MESSAGES/roundup.mo; \ | 60 cp $$file locale/$$lang/LC_MESSAGES/roundup.mo; \ |
| 58 done | 61 done |
| 59 | 62 |
| 60 # helps to check template file before check in | 63 # helps to check template file before check in |
| 61 diff: | 64 diff: |
| 62 svn diff roundup.pot|grep -v '^[-+]#'|vim -Rv - | 65 hg diff roundup.pot|grep -v '^[-+]#'| vi -Rv - |
| 63 | 66 |
| 64 %.po: $(TEMPLATE) | 67 %.po: $(TEMPLATE) |
| 65 ${MSGMERGE} -U --suffix=.bak $@ $< | 68 ${MSGMERGE} -U --suffix=.bak $@ $< |
| 66 | 69 |
| 67 %.mo: %.po | 70 %.mo: %.po |
