git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] i18n: notes: mark comment for translation
@ 2016-07-23 14:10 Vasco Almeida
  2016-07-25 17:49 ` Junio C Hamano
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Vasco Almeida @ 2016-07-23 14:10 UTC (permalink / raw)
  To: Git; +Cc: Ævar Arnfjörð Bjarmason, Vasco Almeida

Mark comment displayed when editing a note for translation.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
---

It seems that strbuf_add_commented_lines adds a trailing newline. So adding
another strbuf_addch(&buf, '\n') would make 2 lines rather only one.

 builtin/notes.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/builtin/notes.c b/builtin/notes.c
index 0572051..1d6a096 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -91,7 +91,7 @@ static const char * const git_notes_get_ref_usage[] = {
 };
 
 static const char note_template[] =
-	"\nWrite/edit the notes for the following object:\n";
+	N_("Write/edit the notes for the following object:");
 
 struct note_data {
 	int given;
@@ -179,7 +179,8 @@ static void prepare_note_data(const unsigned char *object, struct note_data *d,
 			copy_obj_to_fd(fd, old_note);
 
 		strbuf_addch(&buf, '\n');
-		strbuf_add_commented_lines(&buf, note_template, strlen(note_template));
+		strbuf_addch(&buf, '\n');
+		strbuf_add_commented_lines(&buf, _(note_template), strlen(_(note_template)));
 		strbuf_addch(&buf, '\n');
 		write_or_die(fd, buf.buf, buf.len);
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-07-28 16:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-23 14:10 [PATCH v2] i18n: notes: mark comment for translation Vasco Almeida
2016-07-25 17:49 ` Junio C Hamano
2016-07-26 12:16   ` Vasco Almeida
2016-07-26 17:05     ` Junio C Hamano
2016-07-27 10:40       ` Vasco Almeida
2016-07-26 12:16 ` [PATCH v3] " Vasco Almeida
2016-07-26 16:57   ` Junio C Hamano
2016-07-27 10:53     ` Vasco Almeida
2016-07-27 19:33       ` Junio C Hamano
2016-07-28 11:26 ` [PATCH v4] " Vasco Almeida
2016-07-28 16:09   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).