Skip to contentSkip to conversation

Makefile: extract Q_() source strings as ngettext()

PATCH In review Ævar Arnfjörð Bjarmason 3 participants 3 messages Jun 15, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: extract Q_() source strings as ngettext()

The patch adding the Q_() wrapper function around ngettext[1] didn't contain a corresponding update to the "pot" target in the Makefile. As a result "make pot" wouldn't extract gettext messages using the plural form.

1. added by Jonathan Nieder in v1.7.5-rc0~54^2~2 (i18n: add stub Q_() wrapper for ngettext).

---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Makefile +1 -1
index 92c1c5e..2441d56 100644
@@ -2051,7 +2051,7 @@ XGETTEXT_FLAGS = \
 	--add-comments \
 	--msgid-bugs-address="Git Mailing List <[email protected]>" \
 	--from-code=UTF-8
-XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --keyword=_ --keyword=N_ --language=C
+XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --keyword=_ --keyword=N_ --keyword="Q_:1,2" --language=C
 LOCALIZED_C := $(C_OBJ:o=c)
 
 po/git.pot: $(LOCALIZED_C)
Signature · 1 line
1.7.4.1
#1 lore raw

Makefile XGETTEXT_FLAGS = \ · line 2055

Quoted 9 lines · Ævar Arnfjörð Bjarmason
Makefile +1 -1
@@ -2051,7 +2051,7 @@ XGETTEXT_FLAGS = \
 	--add-comments \
 	--msgid-bugs-address="Git Mailing List <[email protected]>" \
 	--from-code=UTF-8
-XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --keyword=_ --keyword=N_ --language=C
+XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --keyword=_ --keyword=N_ --keyword="Q_:1,2" --language=C
 LOCALIZED_C := $(C_OBJ:o=c)

Ack. The line is getting long. Maybe it would make sense to split it up (like this)?

---
 Makefile |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Makefile +2 -1
index 2441d56..2dbe555 100644
@@ -2051,7 +2051,8 @@ XGETTEXT_FLAGS = \
 	--add-comments \
 	--msgid-bugs-address="Git Mailing List <[email protected]>" \
 	--from-code=UTF-8
-XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --keyword=_ --keyword=N_ --keyword="Q_:1,2" --language=C
+XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --language=C \
+	--keyword=_ --keyword=N_ --keyword=Q_:1,2
 LOCALIZED_C := $(C_OBJ:o=c)
 
 po/git.pot: $(LOCALIZED_C)
Signature · 1 line
1.7.5.rc0
#2 lore raw
Quoted 2 lines · Jonathan Nieder

Ack. The line is getting long. Maybe it would make sense to split it up (like this)?

Makes sense, thanks both.

I've re-written the commit log message, by the way. Instead of saying "X forgot to do Y and broke Z", I prefer to say "To make sure Z happens, we need to do Y to augment what X did, and W is how we do Y".