{"thread":{"id":"30906","subject":"[PATCH] i18n: mark outputs of mode changes for i18n","startedAt":"2012-06-26T18:21:50Z","lastAt":"2012-06-26T21:38:58Z","messageCount":2,"participants":["Ralf Thielow","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"194296","messageId":"1340734910-7180-1-git-send-email-ralf.thielow@gmail.com","threadId":"30906","inReplyTo":null,"subject":"[PATCH] i18n: mark outputs of mode changes for i18n","fromName":"Ralf Thielow","fromEmail":"ralf.thielow@gmail.com","sentAt":"2012-06-26T18:21:50Z","receivedAt":"2012-06-26T18:21:50Z","isPatch":true,"sender":{"key":"ralf.thielow@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1275832?v=4"},"body":"Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>\n---\n combine-diff.c |  2 +-\n diff.c         | 10 +++++-----\n 2 Dateien geändert, 6 Zeilen hinzugefügt(+), 6 Zeilen entfernt(-)\n\ndiff --git a/combine-diff.c b/combine-diff.c\nindex 9786680..bf534e4 100644\n--- a/combine-diff.c\n+++ b/combine-diff.c\n@@ -734,7 +734,7 @@ static void show_combined_header(struct combine_diff_path *elem,\n \t\t\t    DIFF_STATUS_ADDED)\n \t\t\t\tadded = 0;\n \t\tif (added)\n-\t\t\tprintf(\"%snew file mode %06o\",\n+\t\t\tprintf(_(\"%snew file mode %06o\"),\n \t\t\t       c_meta, elem->mode);\n \t\telse {\n \t\t\tif (deleted)\ndiff --git a/diff.c b/diff.c\nindex 1a594df..25fcb6f 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -2264,21 +2264,21 @@ static void builtin_diff(const char *name_a,\n \tstrbuf_addf(&header, \"%s%sdiff --git %s %s%s\\n\", line_prefix, set, a_one, b_two, reset);\n \tif (lbl[0][0] == '/') {\n \t\t/* /dev/null */\n-\t\tstrbuf_addf(&header, \"%s%snew file mode %06o%s\\n\", line_prefix, set, two->mode, reset);\n+\t\tstrbuf_addf(&header, \"%s%s%s %06o%s\\n\", line_prefix, set, _(\"new file mode\"), two->mode, reset);\n \t\tif (xfrm_msg)\n \t\t\tstrbuf_addstr(&header, xfrm_msg);\n \t\tmust_show_header = 1;\n \t}\n \telse if (lbl[1][0] == '/') {\n-\t\tstrbuf_addf(&header, \"%s%sdeleted file mode %06o%s\\n\", line_prefix, set, one->mode, reset);\n+\t\tstrbuf_addf(&header, \"%s%s%s %06o%s\\n\", line_prefix, set, _(\"deleted file mode\"), one->mode, reset);\n \t\tif (xfrm_msg)\n \t\t\tstrbuf_addstr(&header, xfrm_msg);\n \t\tmust_show_header = 1;\n \t}\n \telse {\n \t\tif (one->mode != two->mode) {\n-\t\t\tstrbuf_addf(&header, \"%s%sold mode %06o%s\\n\", line_prefix, set, one->mode, reset);\n-\t\t\tstrbuf_addf(&header, \"%s%snew mode %06o%s\\n\", line_prefix, set, two->mode, reset);\n+\t\t\tstrbuf_addf(&header, \"%s%s%s %06o%s\\n\", line_prefix, set, _(\"old mode\"), one->mode, reset);\n+\t\t\tstrbuf_addf(&header, \"%s%s%s %06o%s\\n\", line_prefix, set, _(\"new mode\"), two->mode, reset);\n \t\t\tmust_show_header = 1;\n \t\t}\n \t\tif (xfrm_msg)\n@@ -4130,7 +4130,7 @@ static void show_mode_change(FILE *file, struct diff_filepair *p, int show_name,\n \t\tconst char *line_prefix)\n {\n \tif (p->one->mode && p->two->mode && p->one->mode != p->two->mode) {\n-\t\tfprintf(file, \"%s mode change %06o => %06o%c\", line_prefix, p->one->mode,\n+\t\tfprintf(file, _(\"%s mode change %06o => %06o%c\"), line_prefix, p->one->mode,\n \t\t\tp->two->mode, show_name ? ' ' : '\\n');\n \t\tif (show_name) {\n \t\t\twrite_name_quoted(p->two->path, file, '\\n');\n-- \n1.7.11.1\n"},{"id":"194317","messageId":"7vsjdhah3h.fsf@alter.siamese.dyndns.org","threadId":"30906","inReplyTo":"1340734910-7180-1-git-send-email-ralf.thielow@gmail.com","subject":"Re: [PATCH] i18n: mark outputs of mode changes for i18n","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-06-26T21:38:58Z","receivedAt":"2012-06-26T21:38:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ralf Thielow <ralf.thielow@gmail.com> writes:\n\n> diff --git a/diff.c b/diff.c\n> index 1a594df..25fcb6f 100644\n> --- a/diff.c\n> +++ b/diff.c\n> @@ -2264,21 +2264,21 @@ static void builtin_diff(const char *name_a,\n>  \tstrbuf_addf(&header, \"%s%sdiff --git %s %s%s\\n\", line_prefix, set, a_one, b_two, reset);\n>  \tif (lbl[0][0] == '/') {\n>  \t\t/* /dev/null */\n> -\t\tstrbuf_addf(&header, \"%s%snew file mode %06o%s\\n\", line_prefix, set, two->mode, reset);\n> +\t\tstrbuf_addf(&header, \"%s%s%s %06o%s\\n\", line_prefix, set, _(\"new file mode\"), two->mode, reset);\n>  \t\tif (xfrm_msg)\n>  \t\t\tstrbuf_addstr(&header, xfrm_msg);\n>  \t\tmust_show_header = 1;\n>  \t}\n>  \telse if (lbl[1][0] == '/') {\n> -\t\tstrbuf_addf(&header, \"%s%sdeleted file mode %06o%s\\n\", line_prefix, set, one->mode, reset);\n> +\t\tstrbuf_addf(&header, \"%s%s%s %06o%s\\n\", line_prefix, set, _(\"deleted file mode\"), one->mode, reset);\n>  \t\tif (xfrm_msg)\n>  \t\t\tstrbuf_addstr(&header, xfrm_msg);\n>  \t\tmust_show_header = 1;\n>  \t}\n>  \telse {\n>  \t\tif (one->mode != two->mode) {\n> -\t\t\tstrbuf_addf(&header, \"%s%sold mode %06o%s\\n\", line_prefix, set, one->mode, reset);\n> -\t\t\tstrbuf_addf(&header, \"%s%snew mode %06o%s\\n\", line_prefix, set, two->mode, reset);\n> +\t\t\tstrbuf_addf(&header, \"%s%s%s %06o%s\\n\", line_prefix, set, _(\"old mode\"), one->mode, reset);\n> +\t\t\tstrbuf_addf(&header, \"%s%s%s %06o%s\\n\", line_prefix, set, _(\"new mode\"), two->mode, reset);\n>  \t\t\tmust_show_header = 1;\n>  \t\t}\n>  \t\tif (xfrm_msg)\n> @@ -4130,7 +4130,7 @@ static void show_mode_change(FILE *file, struct diff_filepair *p, int show_name,\n>  \t\tconst char *line_prefix)\n>  {\n>  \tif (p->one->mode && p->two->mode && p->one->mode != p->two->mode) {\n> -\t\tfprintf(file, \"%s mode change %06o => %06o%c\", line_prefix, p->one->mode,\n> +\t\tfprintf(file, _(\"%s mode change %06o => %06o%c\"), line_prefix, p->one->mode,\n>  \t\t\tp->two->mode, show_name ? ' ' : '\\n');\n>  \t\tif (show_name) {\n>  \t\t\twrite_name_quoted(p->two->path, file, '\\n');\n\nI do not see how it makes sense to do this alone, among many other\nmetainfo lines that are not marked for translation.\n\nMore importantly, these lines are not for human consumption but for\nmachine parsing (see builtin/apply.c:parse_git_header() function).\n"}]}