@@ -202,12 +202,25 @@ pseudoxml:
202
202
@echo " Build finished. The pseudo-XML files are in $( BUILDDIR) /pseudoxml."
203
203
204
204
# phony target so we always run
205
+ .PHONY : all-source
205
206
all-source :
206
207
207
208
locale/circuitpython.pot : all-source
208
209
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
209
210
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
210
215
translate : 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 :
211
224
for po in $( shell ls locale/* .po) ; do msgmerge -U $$ po -s --no-fuzzy-matching --add-location=file locale/circuitpython.pot; done
212
225
213
226
merge-translate :
@@ -216,8 +229,10 @@ merge-translate:
216
229
git checkout --theirs -- locale/*
217
230
make translate
218
231
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
221
236
222
237
stubs :
223
238
@mkdir -p circuitpython-stubs
0 commit comments