@@ -202,12 +202,25 @@ pseudoxml:
202202 @echo " Build finished. The pseudo-XML files are in $( BUILDDIR) /pseudoxml."
203203
204204# phony target so we always run
205+ .PHONY : all-source
205206all-source :
206207
207208locale/circuitpython.pot : all-source
208209 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
209210
211+ # Historically, `make translate` updated the .pot file and ran msgmerge.
212+ # However, this was a frequent source of merge conflicts. Weblate can perform
213+ # msgmerge, so make translate merely update the translation template file.
214+ .PHONY : translate
210215translate : locale/circuitpython.pot
216+
217+ # Note that normally we rely on weblate to perform msgmerge. This reduces the
218+ # chance of a merge conflict between developer changes (that only add and
219+ # remove source strings) and weblate changes (that only add and remove
220+ # translated strings from po files). However, in case this is legitimately
221+ # needed we preserve a rule to do it.
222+ .PHONY : msgmerge
223+ msgmerge :
211224 for po in $( shell ls locale/* .po) ; do msgmerge -U $$ po -s --no-fuzzy-matching --add-location=file locale/circuitpython.pot; done
212225
213226merge-translate :
@@ -216,8 +229,10 @@ merge-translate:
216229 git checkout --theirs -- locale/*
217230 make translate
218231
219- check-translate : locale/circuitpython.pot $(wildcard locale/* .po)
220- $(PYTHON ) tools/check_translations.py $^
232+ .PHONY : check-translate
233+ check-translate :
234+ 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
235+ $(PYTHON ) tools/check_translations.py locale/circuitpython.pot.tmp locale/circuitpython.pot; status=$$? ; rm -f locale/circuitpython.pot.tmp; exit $$ status
221236
222237stubs :
223238 @mkdir -p circuitpython-stubs
0 commit comments