Skip to content

Commit adc3b2b

Browse files
avargitster
authored andcommitted
Makefile: add xgettext target for *.sh files
Change the "pot" target to also extract strings from our $(SCRIPT_SH) files with xgettext(1). Note that due to Jonathan Nieder's trick of doing "mv $@+ $@" at the end of the target the "pot" target will now warn: $ make pot XGETTEXT po/git.pot po/git.pot+: warning: Charset "CHARSET" is not a portable encoding name. Message conversion to user's charset might not work. This warnings is emitted because xgettext is writing into a non-*.pot file, it's harmless however. The content that's written out is equivalent to what it would be if we were writing directly into an existing POT file with --join-existing. As part of this change I've eliminated the && chain between xgettext calls, this is incompatible with $(QUIET_XGETTEXT), if the && is left in it'll emit: /bin/sh: @echo: not found Since it's redundant (the Makefile will stop if there's an error) I've removed it altogether. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 64a4295 commit adc3b2b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2065,10 +2065,14 @@ XGETTEXT_FLAGS = \
20652065
--from-code=UTF-8
20662066
XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --language=C \
20672067
--keyword=_ --keyword=N_ --keyword="Q_:1,2"
2068+
XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell
20682069
LOCALIZED_C := $(C_OBJ:o=c)
2070+
LOCALIZED_SH := $(SCRIPT_SH)
20692071

20702072
po/git.pot: $(LOCALIZED_C)
2071-
$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C) && \
2073+
$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C)
2074+
$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing $(XGETTEXT_FLAGS_SH) \
2075+
$(LOCALIZED_SH)
20722076
mv $@+ $@
20732077

20742078
pot: po/git.pot

0 commit comments

Comments
 (0)