diff options
| author | Scott Shawcroft <scott@adafruit.com> | 2020-06-01 14:34:45 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-01 14:34:45 -0700 |
| commit | f4d3c352ae6c176665a26fea3fbdf88ef05516f5 (patch) | |
| tree | 2e9594f7ebfb36f2029a304da04a316c003b1b58 | |
| parent | 2e29f26e5316c815335b93bb5044ac2a13312af4 (diff) | |
| parent | 79e2ede7c1f4c712ba159400e10282c8f28fb033 (diff) | |
Merge pull request #2988 from jepler/change-make-translate
Makefile: "make translate" will only update circuitpython.pot
| -rw-r--r-- | Makefile | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -202,12 +202,25 @@ pseudoxml: @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." # phony target so we always run +.PHONY: all-source all-source: locale/circuitpython.pot: all-source find $(TRANSLATE_SOURCES) -iname "*.c" -print | (LC_ALL=C sort) | xgettext -f- -L C -s --add-location=file --keyword=translate -o circuitpython.pot -p locale +# Historically, `make translate` updated the .pot file and ran msgmerge. +# However, this was a frequent source of merge conflicts. Weblate can perform +# msgmerge, so make translate merely update the translation template file. +.PHONY: translate translate: locale/circuitpython.pot + +# Note that normally we rely on weblate to perform msgmerge. This reduces the +# chance of a merge conflict between developer changes (that only add and +# remove source strings) and weblate changes (that only add and remove +# translated strings from po files). However, in case this is legitimately +# needed we preserve a rule to do it. +.PHONY: msgmerge +msgmerge: for po in $(shell ls locale/*.po); do msgmerge -U $$po -s --no-fuzzy-matching --add-location=file locale/circuitpython.pot; done merge-translate: @@ -216,8 +229,10 @@ merge-translate: git checkout --theirs -- locale/* make translate -check-translate: locale/circuitpython.pot $(wildcard locale/*.po) - $(PYTHON) tools/check_translations.py $^ +.PHONY: check-translate +check-translate: + find $(TRANSLATE_SOURCES) -iname "*.c" -print | (LC_ALL=C sort) | xgettext -f- -L C -s --add-location=file --keyword=translate -o circuitpython.pot.tmp -p locale + $(PYTHON) tools/check_translations.py locale/circuitpython.pot.tmp locale/circuitpython.pot; status=$$?; rm -f locale/circuitpython.pot.tmp; exit $$status stubs: @mkdir -p circuitpython-stubs |
