{"thread":{"id":"42898","subject":"[PATCH] i18n: notes: mark comment for translation","startedAt":"2016-07-21T10:08:48Z","lastAt":"2016-07-21T10:45:46Z","messageCount":2,"participants":["Vasco Almeida","Ævar Arnfjörð Bjarmason"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"291907","messageId":"1469095670-3834-1-git-send-email-vascomalmeida@sapo.pt","threadId":"42898","inReplyTo":null,"subject":"[PATCH] i18n: notes: mark comment for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-07-21T10:07:50Z","receivedAt":"2016-07-21T10:08:48Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark comment displayed when editing a note for translation.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/notes.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/notes.c b/builtin/notes.c\nindex 0572051..37933bd 100644\n--- a/builtin/notes.c\n+++ b/builtin/notes.c\n@@ -91,7 +91,7 @@ static const char * const git_notes_get_ref_usage[] = {\n };\n \n static const char note_template[] =\n-\t\"\\nWrite/edit the notes for the following object:\\n\";\n+\tN_(\"\\nWrite/edit the notes for the following object:\\n\");\n \n struct note_data {\n \tint given;\n@@ -179,7 +179,7 @@ static void prepare_note_data(const unsigned char *object, struct note_data *d,\n \t\t\tcopy_obj_to_fd(fd, old_note);\n \n \t\tstrbuf_addch(&buf, '\\n');\n-\t\tstrbuf_add_commented_lines(&buf, note_template, strlen(note_template));\n+\t\tstrbuf_add_commented_lines(&buf, _(note_template), strlen(_(note_template)));\n \t\tstrbuf_addch(&buf, '\\n');\n \t\twrite_or_die(fd, buf.buf, buf.len);\n \n-- \n2.7.4\n\n"},{"id":"291908","messageId":"CACBZZX51K=D2gYbzKvJW3B5=bzxEGGFhOc6TkAfJkkpdYuEt0w@mail.gmail.com","threadId":"42898","inReplyTo":"1469095670-3834-1-git-send-email-vascomalmeida@sapo.pt","subject":"Re: [PATCH] i18n: notes: mark comment for translation","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2016-07-21T10:45:22Z","receivedAt":"2016-07-21T10:45:46Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Thu, Jul 21, 2016 at 12:07 PM, Vasco Almeida <vascomalmeida@sapo.pt> wrote:\n> Mark comment displayed when editing a note for translation.\n\nI'm not sure, but wouldn't this make more sense:\n\n> Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n> ---\n>  builtin/notes.c | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/builtin/notes.c b/builtin/notes.c\n> index 0572051..37933bd 100644\n> --- a/builtin/notes.c\n> +++ b/builtin/notes.c\n> @@ -91,7 +91,7 @@ static const char * const git_notes_get_ref_usage[] = {\n>  };\n>\n>  static const char note_template[] =\n> -       \"\\nWrite/edit the notes for the following object:\\n\";\n> +       N_(\"\\nWrite/edit the notes for the following object:\\n\");\n+       N_(\"Write/edit the notes for the following object:\");\n>\n>  struct note_data {\n>         int given;\n> @@ -179,7 +179,7 @@ static void prepare_note_data(const unsigned char *object, struct note_data *d,\n>                         copy_obj_to_fd(fd, old_note);\n>\n>                 strbuf_addch(&buf, '\\n');\n+                 strbuf_addch(&buf, '\\n');\n> -               strbuf_add_commented_lines(&buf, note_template, strlen(note_template));\n> +               strbuf_add_commented_lines(&buf, _(note_template), strlen(_(note_template)));\n+                 strbuf_addch(&buf, '\\n');\n>                 strbuf_addch(&buf, '\\n');\n>                 write_or_die(fd, buf.buf, buf.len);\n\nI.e. moving the starting and ending \\n out of the message itself, the\nsurrounding whitespace doesn't seem like something the translators\nneed to modify, and if they were to trim it it looks like it would\nbreak the output a bit.\n"}]}