{"thread":{"id":"44062","subject":"[PATCH v2 06/14] i18n: config: mark error message for translation","startedAt":"2016-09-12T11:31:41Z","lastAt":"2016-09-13T22:01:16Z","messageCount":26,"participants":["Vasco Almeida","Jean-Noël Avila","Junio C Hamano","Jean-Noël AVILA"],"isPatch":true,"patchVersion":2,"patchTotal":14},"messages":[{"id":"301700","messageId":"1473679802-31381-6-git-send-email-vascomalmeida@sapo.pt","threadId":"44062","inReplyTo":"1473679802-31381-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v2 06/14] i18n: config: mark error message for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-12T11:29:54Z","receivedAt":"2016-09-12T11:31:41Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/config.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/config.c b/builtin/config.c\nindex 6cbf733..05843a0 100644\n--- a/builtin/config.c\n+++ b/builtin/config.c\n@@ -622,8 +622,8 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \t\tvalue = normalize_value(argv[0], argv[1]);\n \t\tret = git_config_set_in_file_gently(given_config_source.file, argv[0], value);\n \t\tif (ret == CONFIG_NOTHING_SET)\n-\t\t\terror(\"cannot overwrite multiple values with a single value\\n\"\n-\t\t\t\"       Use a regexp, --add or --replace-all to change %s.\", argv[0]);\n+\t\t\terror(_(\"cannot overwrite multiple values with a single value\\n\"\n+\t\t\t\"       Use a regexp, --add or --replace-all to change %s.\"), argv[0]);\n \t\treturn ret;\n \t}\n \telse if (actions == ACTION_SET_ALL) {\n-- \n2.7.4\n\n"},{"id":"301701","messageId":"1473679802-31381-10-git-send-email-vascomalmeida@sapo.pt","threadId":"44062","inReplyTo":"1473679802-31381-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v2 10/14] notes: lowercase first word of error messages","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-12T11:29:58Z","receivedAt":"2016-09-12T11:31:59Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Follow the usual case style.\n\nUpdate one test to reflect these changes.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/notes.c                  | 64 ++++++++++++++++++++--------------------\n t/t3320-notes-merge-worktrees.sh |  2 +-\n 2 files changed, 33 insertions(+), 33 deletions(-)\n\ndiff --git a/builtin/notes.c b/builtin/notes.c\nindex abacae2..14488ba 100644\n--- a/builtin/notes.c\n+++ b/builtin/notes.c\n@@ -191,7 +191,7 @@ static void prepare_note_data(const unsigned char *object, struct note_data *d,\n \t\tstrbuf_reset(&d->buf);\n \n \t\tif (launch_editor(d->edit_path, &d->buf, NULL)) {\n-\t\t\tdie(_(\"Please supply the note contents using either -m or -F option\"));\n+\t\t\tdie(_(\"please supply the note contents using either -m or -F option\"));\n \t\t}\n \t\tstrbuf_stripspace(&d->buf, 1);\n \t}\n@@ -202,7 +202,7 @@ static void write_note_data(struct note_data *d, unsigned char *sha1)\n \tif (write_sha1_file(d->buf.buf, d->buf.len, blob_type, sha1)) {\n \t\terror(_(\"unable to write note object\"));\n \t\tif (d->edit_path)\n-\t\t\terror(_(\"The note contents have been left in %s\"),\n+\t\t\terror(_(\"the note contents have been left in %s\"),\n \t\t\t\td->edit_path);\n \t\texit(128);\n \t}\n@@ -251,14 +251,14 @@ static int parse_reuse_arg(const struct option *opt, const char *arg, int unset)\n \t\tstrbuf_addch(&d->buf, '\\n');\n \n \tif (get_sha1(arg, object))\n-\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), arg);\n+\t\tdie(_(\"failed to resolve '%s' as a valid ref.\"), arg);\n \tif (!(buf = read_sha1_file(object, &type, &len))) {\n \t\tfree(buf);\n-\t\tdie(_(\"Failed to read object '%s'.\"), arg);\n+\t\tdie(_(\"failed to read object '%s'.\"), arg);\n \t}\n \tif (type != OBJ_BLOB) {\n \t\tfree(buf);\n-\t\tdie(_(\"Cannot read note data from non-blob object '%s'.\"), arg);\n+\t\tdie(_(\"cannot read note data from non-blob object '%s'.\"), arg);\n \t}\n \tstrbuf_add(&d->buf, buf, len);\n \tfree(buf);\n@@ -298,13 +298,13 @@ static int notes_copy_from_stdin(int force, const char *rewrite_cmd)\n \n \t\tsplit = strbuf_split(&buf, ' ');\n \t\tif (!split[0] || !split[1])\n-\t\t\tdie(_(\"Malformed input line: '%s'.\"), buf.buf);\n+\t\t\tdie(_(\"malformed input line: '%s'.\"), buf.buf);\n \t\tstrbuf_rtrim(split[0]);\n \t\tstrbuf_rtrim(split[1]);\n \t\tif (get_sha1(split[0]->buf, from_obj))\n-\t\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), split[0]->buf);\n+\t\t\tdie(_(\"failed to resolve '%s' as a valid ref.\"), split[0]->buf);\n \t\tif (get_sha1(split[1]->buf, to_obj))\n-\t\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), split[1]->buf);\n+\t\t\tdie(_(\"failed to resolve '%s' as a valid ref.\"), split[1]->buf);\n \n \t\tif (rewrite_cmd)\n \t\t\terr = copy_note_for_rewrite(c, from_obj, to_obj);\n@@ -313,7 +313,7 @@ static int notes_copy_from_stdin(int force, const char *rewrite_cmd)\n \t\t\t\t\tcombine_notes_overwrite);\n \n \t\tif (err) {\n-\t\t\terror(_(\"Failed to copy notes from '%s' to '%s'\"),\n+\t\t\terror(_(\"failed to copy notes from '%s' to '%s'\"),\n \t\t\t      split[0]->buf, split[1]->buf);\n \t\t\tret = 1;\n \t\t}\n@@ -340,7 +340,7 @@ static struct notes_tree *init_notes_check(const char *subcommand,\n \n \tref = (flags & NOTES_INIT_WRITABLE) ? t->update_ref : t->ref;\n \tif (!starts_with(ref, \"refs/notes/\"))\n-\t\tdie(_(\"Refusing to %s notes in %s (outside of refs/notes/)\"),\n+\t\tdie(_(\"refusing to %s notes in %s (outside of refs/notes/)\"),\n \t\t    subcommand, ref);\n \treturn t;\n }\n@@ -367,13 +367,13 @@ static int list(int argc, const char **argv, const char *prefix)\n \tt = init_notes_check(\"list\", 0);\n \tif (argc) {\n \t\tif (get_sha1(argv[0], object))\n-\t\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), argv[0]);\n+\t\t\tdie(_(\"failed to resolve '%s' as a valid ref.\"), argv[0]);\n \t\tnote = get_note(t, object);\n \t\tif (note) {\n \t\t\tputs(sha1_to_hex(note));\n \t\t\tretval = 0;\n \t\t} else\n-\t\t\tretval = error(_(\"No note found for object %s.\"),\n+\t\t\tretval = error(_(\"no note found for object %s.\"),\n \t\t\t\t       sha1_to_hex(object));\n \t} else\n \t\tretval = for_each_note(t, 0, list_each_note, NULL);\n@@ -422,7 +422,7 @@ static int add(int argc, const char **argv, const char *prefix)\n \tobject_ref = argc > 1 ? argv[1] : \"HEAD\";\n \n \tif (get_sha1(object_ref, object))\n-\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), object_ref);\n+\t\tdie(_(\"failed to resolve '%s' as a valid ref.\"), object_ref);\n \n \tt = init_notes_check(\"add\", NOTES_INIT_WRITABLE);\n \tnote = get_note(t, object);\n@@ -508,12 +508,12 @@ static int copy(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (get_sha1(argv[0], from_obj))\n-\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), argv[0]);\n+\t\tdie(_(\"failed to resolve '%s' as a valid ref.\"), argv[0]);\n \n \tobject_ref = 1 < argc ? argv[1] : \"HEAD\";\n \n \tif (get_sha1(object_ref, object))\n-\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), object_ref);\n+\t\tdie(_(\"failed to resolve '%s' as a valid ref.\"), object_ref);\n \n \tt = init_notes_check(\"copy\", NOTES_INIT_WRITABLE);\n \tnote = get_note(t, object);\n@@ -532,7 +532,7 @@ static int copy(int argc, const char **argv, const char *prefix)\n \n \tfrom_note = get_note(t, from_obj);\n \tif (!from_note) {\n-\t\tretval = error(_(\"Missing notes on source object %s. Cannot \"\n+\t\tretval = error(_(\"missing notes on source object %s. Cannot \"\n \t\t\t       \"copy.\"), sha1_to_hex(from_obj));\n \t\tgoto out;\n \t}\n@@ -591,7 +591,7 @@ static int append_edit(int argc, const char **argv, const char *prefix)\n \tobject_ref = 1 < argc ? argv[1] : \"HEAD\";\n \n \tif (get_sha1(object_ref, object))\n-\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), object_ref);\n+\t\tdie(_(\"failed to resolve '%s' as a valid ref.\"), object_ref);\n \n \tt = init_notes_check(argv[0], NOTES_INIT_WRITABLE);\n \tnote = get_note(t, object);\n@@ -654,13 +654,13 @@ static int show(int argc, const char **argv, const char *prefix)\n \tobject_ref = argc ? argv[0] : \"HEAD\";\n \n \tif (get_sha1(object_ref, object))\n-\t\tdie(_(\"Failed to resolve '%s' as a valid ref.\"), object_ref);\n+\t\tdie(_(\"failed to resolve '%s' as a valid ref.\"), object_ref);\n \n \tt = init_notes_check(\"show\", 0);\n \tnote = get_note(t, object);\n \n \tif (!note)\n-\t\tretval = error(_(\"No note found for object %s.\"),\n+\t\tretval = error(_(\"no note found for object %s.\"),\n \t\t\t       sha1_to_hex(object));\n \telse {\n \t\tconst char *show_args[3] = {\"show\", sha1_to_hex(note), NULL};\n@@ -680,11 +680,11 @@ static int merge_abort(struct notes_merge_options *o)\n \t */\n \n \tif (delete_ref(\"NOTES_MERGE_PARTIAL\", NULL, 0))\n-\t\tret += error(_(\"Failed to delete ref NOTES_MERGE_PARTIAL\"));\n+\t\tret += error(_(\"failed to delete ref NOTES_MERGE_PARTIAL\"));\n \tif (delete_ref(\"NOTES_MERGE_REF\", NULL, REF_NODEREF))\n-\t\tret += error(_(\"Failed to delete ref NOTES_MERGE_REF\"));\n+\t\tret += error(_(\"failed to delete ref NOTES_MERGE_REF\"));\n \tif (notes_merge_abort(o))\n-\t\tret += error(_(\"Failed to remove 'git notes merge' worktree\"));\n+\t\tret += error(_(\"failed to remove 'git notes merge' worktree\"));\n \treturn ret;\n }\n \n@@ -704,11 +704,11 @@ static int merge_commit(struct notes_merge_options *o)\n \t */\n \n \tif (get_sha1(\"NOTES_MERGE_PARTIAL\", sha1))\n-\t\tdie(_(\"Failed to read ref NOTES_MERGE_PARTIAL\"));\n+\t\tdie(_(\"failed to read ref NOTES_MERGE_PARTIAL\"));\n \telse if (!(partial = lookup_commit_reference(sha1)))\n-\t\tdie(_(\"Could not find commit from NOTES_MERGE_PARTIAL.\"));\n+\t\tdie(_(\"could not find commit from NOTES_MERGE_PARTIAL.\"));\n \telse if (parse_commit(partial))\n-\t\tdie(_(\"Could not parse commit from NOTES_MERGE_PARTIAL.\"));\n+\t\tdie(_(\"could not parse commit from NOTES_MERGE_PARTIAL.\"));\n \n \tif (partial->parents)\n \t\thashcpy(parent_sha1, partial->parents->item->object.oid.hash);\n@@ -721,10 +721,10 @@ static int merge_commit(struct notes_merge_options *o)\n \to->local_ref = local_ref_to_free =\n \t\tresolve_refdup(\"NOTES_MERGE_REF\", 0, sha1, NULL);\n \tif (!o->local_ref)\n-\t\tdie(_(\"Failed to resolve NOTES_MERGE_REF\"));\n+\t\tdie(_(\"failed to resolve NOTES_MERGE_REF\"));\n \n \tif (notes_merge_commit(o, t, partial, sha1))\n-\t\tdie(_(\"Failed to finalize notes merge\"));\n+\t\tdie(_(\"failed to finalize notes merge\"));\n \n \t/* Reuse existing commit message in reflog message */\n \tmemset(&pretty_ctx, 0, sizeof(pretty_ctx));\n@@ -794,7 +794,7 @@ static int merge(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (do_merge && argc != 1) {\n-\t\terror(_(\"Must specify a notes ref to merge\"));\n+\t\terror(_(\"must specify a notes ref to merge\"));\n \t\tusage_with_options(git_notes_merge_usage, options);\n \t} else if (!do_merge && argc) {\n \t\terror(_(\"too many parameters\"));\n@@ -818,7 +818,7 @@ static int merge(int argc, const char **argv, const char *prefix)\n \n \tif (strategy) {\n \t\tif (parse_notes_merge_strategy(strategy, &o.strategy)) {\n-\t\t\terror(_(\"Unknown -s/--strategy: %s\"), strategy);\n+\t\t\terror(_(\"unknown -s/--strategy: %s\"), strategy);\n \t\t\tusage_with_options(git_notes_merge_usage, options);\n \t\t}\n \t} else {\n@@ -855,10 +855,10 @@ static int merge(int argc, const char **argv, const char *prefix)\n \t\t/* Store ref-to-be-updated into .git/NOTES_MERGE_REF */\n \t\twt = find_shared_symref(\"NOTES_MERGE_REF\", default_notes_ref());\n \t\tif (wt)\n-\t\t\tdie(_(\"A notes merge into %s is already in-progress at %s\"),\n+\t\t\tdie(_(\"a notes merge into %s is already in-progress at %s\"),\n \t\t\t    default_notes_ref(), wt->path);\n \t\tif (create_symref(\"NOTES_MERGE_REF\", default_notes_ref(), NULL))\n-\t\t\tdie(_(\"Failed to store link to current notes ref (%s)\"),\n+\t\t\tdie(_(\"failed to store link to current notes ref (%s)\"),\n \t\t\t    default_notes_ref());\n \t\tprintf(_(\"Automatic notes merge failed. Fix conflicts in %s and \"\n \t\t\t \"commit the result with 'git notes merge --commit', or \"\n@@ -1014,7 +1014,7 @@ int cmd_notes(int argc, const char **argv, const char *prefix)\n \telse if (!strcmp(argv[0], \"get-ref\"))\n \t\tresult = get_ref(argc, argv, prefix);\n \telse {\n-\t\tresult = error(_(\"Unknown subcommand: %s\"), argv[0]);\n+\t\tresult = error(_(\"unknown subcommand: %s\"), argv[0]);\n \t\tusage_with_options(git_notes_usage, options);\n \t}\n \ndiff --git a/t/t3320-notes-merge-worktrees.sh b/t/t3320-notes-merge-worktrees.sh\nindex 6e05115..b9c3bc2 100755\n--- a/t/t3320-notes-merge-worktrees.sh\n+++ b/t/t3320-notes-merge-worktrees.sh\n@@ -52,7 +52,7 @@ test_expect_success 'merge z into y while mid-merge in another workdir fails' '\n \t\tcd worktree &&\n \t\tgit config core.notesRef refs/notes/y &&\n \t\ttest_must_fail git notes merge z 2>err &&\n-\t\ttest_i18ngrep \"A notes merge into refs/notes/y is already in-progress at\" err\n+\t\ttest_i18ngrep \"a notes merge into refs/notes/y is already in-progress at\" err\n \t) &&\n \ttest_path_is_missing .git/worktrees/worktree/NOTES_MERGE_REF\n '\n-- \n2.7.4\n\n"},{"id":"301703","messageId":"1473679802-31381-1-git-send-email-vascomalmeida@sapo.pt","threadId":"44062","inReplyTo":"1473259758-11836-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v2 01/14] i18n: apply: mark plural string for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-12T11:29:49Z","receivedAt":"2016-09-12T11:37:49Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark plural string for translation using Q_().\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/apply.c | 10 ++++++----\n 1 file changed, 6 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/apply.c b/builtin/apply.c\nindex 1a488f9..ef03c74 100644\n--- a/builtin/apply.c\n+++ b/builtin/apply.c\n@@ -4768,10 +4768,12 @@ static int apply_all_patches(struct apply_state *state,\n \t\t\t       state->whitespace_error),\n \t\t\t    state->whitespace_error);\n \t\tif (state->applied_after_fixing_ws && state->apply)\n-\t\t\twarning(\"%d line%s applied after\"\n-\t\t\t\t\" fixing whitespace errors.\",\n-\t\t\t\tstate->applied_after_fixing_ws,\n-\t\t\t\tstate->applied_after_fixing_ws == 1 ? \"\" : \"s\");\n+\t\t\twarning(Q_(\"%d line applied after\"\n+\t\t\t\t   \" fixing whitespace errors.\",\n+\t\t\t\t   \"%d lines applied after\"\n+\t\t\t\t   \" fixing whitespace errors.\",\n+\t\t\t\t   state->applied_after_fixing_ws),\n+\t\t\t\tstate->applied_after_fixing_ws);\n \t\telse if (state->whitespace_error)\n \t\t\twarning(Q_(\"%d line adds whitespace errors.\",\n \t\t\t\t   \"%d lines add whitespace errors.\",\n-- \n2.7.4\n\n"},{"id":"301704","messageId":"1473679802-31381-2-git-send-email-vascomalmeida@sapo.pt","threadId":"44062","inReplyTo":"1473679802-31381-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v2 02/14] i18n: apply: mark error messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-12T11:29:50Z","receivedAt":"2016-09-12T11:38:02Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark error messages for translation passed to error() and die()\nfunctions.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/apply.c | 46 +++++++++++++++++++++++-----------------------\n 1 file changed, 23 insertions(+), 23 deletions(-)\n\ndiff --git a/builtin/apply.c b/builtin/apply.c\nindex ef03c74..ef2c084 100644\n--- a/builtin/apply.c\n+++ b/builtin/apply.c\n@@ -3065,8 +3065,8 @@ static int apply_binary_fragment(struct apply_state *state,\n \t/* Binary patch is irreversible without the optional second hunk */\n \tif (state->apply_in_reverse) {\n \t\tif (!fragment->next)\n-\t\t\treturn error(\"cannot reverse-apply a binary patch \"\n-\t\t\t\t     \"without the reverse hunk to '%s'\",\n+\t\t\treturn error(_(\"cannot reverse-apply a binary patch \"\n+\t\t\t\t       \"without the reverse hunk to '%s'\"),\n \t\t\t\t     patch->new_name\n \t\t\t\t     ? patch->new_name : patch->old_name);\n \t\tfragment = fragment->next;\n@@ -3111,8 +3111,8 @@ static int apply_binary(struct apply_state *state,\n \t    strlen(patch->new_sha1_prefix) != 40 ||\n \t    get_sha1_hex(patch->old_sha1_prefix, sha1) ||\n \t    get_sha1_hex(patch->new_sha1_prefix, sha1))\n-\t\treturn error(\"cannot apply binary patch to '%s' \"\n-\t\t\t     \"without full index line\", name);\n+\t\treturn error(_(\"cannot apply binary patch to '%s' \"\n+\t\t\t       \"without full index line\"), name);\n \n \tif (patch->old_name) {\n \t\t/*\n@@ -3121,16 +3121,16 @@ static int apply_binary(struct apply_state *state,\n \t\t */\n \t\thash_sha1_file(img->buf, img->len, blob_type, sha1);\n \t\tif (strcmp(sha1_to_hex(sha1), patch->old_sha1_prefix))\n-\t\t\treturn error(\"the patch applies to '%s' (%s), \"\n-\t\t\t\t     \"which does not match the \"\n-\t\t\t\t     \"current contents.\",\n+\t\t\treturn error(_(\"the patch applies to '%s' (%s), \"\n+\t\t\t\t       \"which does not match the \"\n+\t\t\t\t       \"current contents.\"),\n \t\t\t\t     name, sha1_to_hex(sha1));\n \t}\n \telse {\n \t\t/* Otherwise, the old one must be empty. */\n \t\tif (img->len)\n-\t\t\treturn error(\"the patch applies to an empty \"\n-\t\t\t\t     \"'%s' but it is not empty\", name);\n+\t\t\treturn error(_(\"the patch applies to an empty \"\n+\t\t\t\t       \"'%s' but it is not empty\"), name);\n \t}\n \n \tget_sha1_hex(patch->new_sha1_prefix, sha1);\n@@ -3147,8 +3147,8 @@ static int apply_binary(struct apply_state *state,\n \n \t\tresult = read_sha1_file(sha1, &type, &size);\n \t\tif (!result)\n-\t\t\treturn error(\"the necessary postimage %s for \"\n-\t\t\t\t     \"'%s' cannot be read\",\n+\t\t\treturn error(_(\"the necessary postimage %s for \"\n+\t\t\t\t       \"'%s' cannot be read\"),\n \t\t\t\t     patch->new_sha1_prefix, name);\n \t\tclear_image(img);\n \t\timg->buf = result;\n@@ -3523,7 +3523,7 @@ static int try_threeway(struct apply_state *state,\n \t\twrite_sha1_file(\"\", 0, blob_type, pre_sha1);\n \telse if (get_sha1(patch->old_sha1_prefix, pre_sha1) ||\n \t\t read_blob_object(&buf, pre_sha1, patch->old_mode))\n-\t\treturn error(\"repository lacks the necessary blob to fall back on 3-way merge.\");\n+\t\treturn error(_(\"repository lacks the necessary blob to fall back on 3-way merge.\"));\n \n \tfprintf(stderr, \"Falling back to three-way merge...\\n\");\n \n@@ -3541,11 +3541,11 @@ static int try_threeway(struct apply_state *state,\n \t/* our_sha1[] is ours */\n \tif (patch->is_new) {\n \t\tif (load_current(state, &tmp_image, patch))\n-\t\t\treturn error(\"cannot read the current contents of '%s'\",\n+\t\t\treturn error(_(\"cannot read the current contents of '%s'\"),\n \t\t\t\t     patch->new_name);\n \t} else {\n \t\tif (load_preimage(state, &tmp_image, patch, st, ce))\n-\t\t\treturn error(\"cannot read the current contents of '%s'\",\n+\t\t\treturn error(_(\"cannot read the current contents of '%s'\"),\n \t\t\t\t     patch->old_name);\n \t}\n \twrite_sha1_file(tmp_image.buf, tmp_image.len, blob_type, our_sha1);\n@@ -4020,29 +4020,29 @@ static void build_fake_ancestor(struct patch *list, const char *filename)\n \t\t\tif (!preimage_sha1_in_gitlink_patch(patch, sha1))\n \t\t\t\t; /* ok, the textual part looks sane */\n \t\t\telse\n-\t\t\t\tdie(\"sha1 information is lacking or useless for submodule %s\",\n+\t\t\t\tdie(_(\"sha1 information is lacking or useless for submodule %s\"),\n \t\t\t\t    name);\n \t\t} else if (!get_sha1_blob(patch->old_sha1_prefix, sha1)) {\n \t\t\t; /* ok */\n \t\t} else if (!patch->lines_added && !patch->lines_deleted) {\n \t\t\t/* mode-only change: update the current */\n \t\t\tif (get_current_sha1(patch->old_name, sha1))\n-\t\t\t\tdie(\"mode change for %s, which is not \"\n-\t\t\t\t    \"in current HEAD\", name);\n+\t\t\t\tdie(_(\"mode change for %s, which is not \"\n+\t\t\t\t    \"in current HEAD\"), name);\n \t\t} else\n-\t\t\tdie(\"sha1 information is lacking or useless \"\n-\t\t\t    \"(%s).\", name);\n+\t\t\tdie(_(\"sha1 information is lacking or useless \"\n+\t\t\t    \"(%s).\"), name);\n \n \t\tce = make_cache_entry(patch->old_mode, sha1, name, 0, 0);\n \t\tif (!ce)\n \t\t\tdie(_(\"make_cache_entry failed for path '%s'\"), name);\n \t\tif (add_index_entry(&result, ce, ADD_CACHE_OK_TO_ADD))\n-\t\t\tdie (\"Could not add %s to temporary index\", name);\n+\t\t\tdie(_(\"Could not add %s to temporary index\"), name);\n \t}\n \n \thold_lock_file_for_update(&lock, filename, LOCK_DIE_ON_ERROR);\n \tif (write_locked_index(&result, &lock, COMMIT_LOCK))\n-\t\tdie (\"Could not write temporary index to %s\", filename);\n+\t\tdie(_(\"Could not write temporary index to %s\"), filename);\n \n \tdiscard_index(&result);\n }\n@@ -4693,9 +4693,9 @@ static void check_apply_state(struct apply_state *state, int force_apply)\n \tint is_not_gitdir = !startup_info->have_repository;\n \n \tif (state->apply_with_reject && state->threeway)\n-\t\tdie(\"--reject and --3way cannot be used together.\");\n+\t\tdie(_(\"--reject and --3way cannot be used together.\"));\n \tif (state->cached && state->threeway)\n-\t\tdie(\"--cached and --3way cannot be used together.\");\n+\t\tdie(_(\"--cached and --3way cannot be used together.\"));\n \tif (state->threeway) {\n \t\tif (is_not_gitdir)\n \t\t\tdie(_(\"--3way outside a repository\"));\n-- \n2.7.4\n\n"},{"id":"301705","messageId":"1473679802-31381-4-git-send-email-vascomalmeida@sapo.pt","threadId":"44062","inReplyTo":"1473679802-31381-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v2 04/14] i18n: blame: mark error messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-12T11:29:52Z","receivedAt":"2016-09-12T11:38:05Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark error messages for translation passed to die() function.\nChange \"Cannot\" to lowercase following the usual style.\n\nReflect changes to test by using test_i18ngrep.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/blame.c               | 18 ++++++++++--------\n t/t8003-blame-corner-cases.sh |  4 ++--\n 2 files changed, 12 insertions(+), 10 deletions(-)\n\ndiff --git a/builtin/blame.c b/builtin/blame.c\nindex a5bbf91..27aea79 100644\n--- a/builtin/blame.c\n+++ b/builtin/blame.c\n@@ -2601,7 +2601,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n \n \tif (incremental || (output_option & OUTPUT_PORCELAIN)) {\n \t\tif (show_progress > 0)\n-\t\t\tdie(\"--progress can't be used with --incremental or porcelain formats\");\n+\t\t\tdie(_(\"--progress can't be used with --incremental or porcelain formats\"));\n \t\tshow_progress = 0;\n \t} else if (show_progress < 0)\n \t\tshow_progress = isatty(2);\n@@ -2727,7 +2727,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n \t\tsb.commits.compare = compare_commits_by_commit_date;\n \t}\n \telse if (contents_from)\n-\t\tdie(\"--contents and --reverse do not blend well.\");\n+\t\tdie(_(\"--contents and --reverse do not blend well.\"));\n \telse {\n \t\tfinal_commit_name = prepare_initial(&sb);\n \t\tsb.commits.compare = compare_commits_by_reverse_commit_date;\n@@ -2747,12 +2747,12 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n \t\tadd_pending_object(&revs, &(sb.final->object), \":\");\n \t}\n \telse if (contents_from)\n-\t\tdie(\"Cannot use --contents with final commit object name\");\n+\t\tdie(_(\"cannot use --contents with final commit object name\"));\n \n \tif (reverse && revs.first_parent_only) {\n \t\tfinal_commit = find_single_final(sb.revs, NULL);\n \t\tif (!final_commit)\n-\t\t\tdie(\"--reverse and --first-parent together require specified latest commit\");\n+\t\t\tdie(_(\"--reverse and --first-parent together require specified latest commit\"));\n \t}\n \n \t/*\n@@ -2779,7 +2779,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n \t\t}\n \n \t\tif (oidcmp(&c->object.oid, &sb.final->object.oid))\n-\t\t\tdie(\"--reverse --first-parent together require range along first-parent chain\");\n+\t\t\tdie(_(\"--reverse --first-parent together require range along first-parent chain\"));\n \t}\n \n \tif (is_null_oid(&sb.final->object.oid)) {\n@@ -2790,7 +2790,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n \telse {\n \t\to = get_origin(&sb, sb.final, path);\n \t\tif (fill_blob_sha1_and_mode(o))\n-\t\t\tdie(\"no such path %s in %s\", path, final_commit_name);\n+\t\t\tdie(_(\"no such path %s in %s\"), path, final_commit_name);\n \n \t\tif (DIFF_OPT_TST(&sb.revs->diffopt, ALLOW_TEXTCONV) &&\n \t\t    textconv_object(path, o->mode, o->blob_sha1, 1, (char **) &sb.final_buf,\n@@ -2801,7 +2801,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n \t\t\t\t\t\t      &sb.final_buf_size);\n \n \t\tif (!sb.final_buf)\n-\t\t\tdie(\"Cannot read blob %s for path %s\",\n+\t\t\tdie(_(\"cannot read blob %s for path %s\"),\n \t\t\t    sha1_to_hex(o->blob_sha1),\n \t\t\t    path);\n \t}\n@@ -2820,7 +2820,9 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n \t\t\t\t    &bottom, &top, sb.path))\n \t\t\tusage(blame_usage);\n \t\tif (lno < top || ((lno || bottom) && lno < bottom))\n-\t\t\tdie(\"file %s has only %lu lines\", path, lno);\n+\t\t\tdie(Q_(\"file %s has only %lu line\",\n+\t\t\t       \"file %s has only %lu lines\",\n+\t\t\t       lno), path, lno);\n \t\tif (bottom < 1)\n \t\t\tbottom = 1;\n \t\tif (top < 1)\ndiff --git a/t/t8003-blame-corner-cases.sh b/t/t8003-blame-corner-cases.sh\nindex e48370d..661f9d4 100755\n--- a/t/t8003-blame-corner-cases.sh\n+++ b/t/t8003-blame-corner-cases.sh\n@@ -212,12 +212,12 @@ EOF\n \n test_expect_success 'blame -L with invalid start' '\n \ttest_must_fail git blame -L5 tres 2>errors &&\n-\tgrep \"has only 2 lines\" errors\n+\ttest_i18ngrep \"has only 2 lines\" errors\n '\n \n test_expect_success 'blame -L with invalid end' '\n \ttest_must_fail git blame -L1,5 tres 2>errors &&\n-\tgrep \"has only 2 lines\" errors\n+\ttest_i18ngrep \"has only 2 lines\" errors\n '\n \n test_expect_success 'blame parses <end> part of -L' '\n-- \n2.7.4\n\n"},{"id":"301706","messageId":"1473679802-31381-3-git-send-email-vascomalmeida@sapo.pt","threadId":"44062","inReplyTo":"1473679802-31381-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v2 03/14] i18n: apply: mark info messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-12T11:29:51Z","receivedAt":"2016-09-12T11:38:06Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark messages for translation printed to stderr.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/apply.c | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/apply.c b/builtin/apply.c\nindex ef2c084..43ab7c5 100644\n--- a/builtin/apply.c\n+++ b/builtin/apply.c\n@@ -3525,7 +3525,7 @@ static int try_threeway(struct apply_state *state,\n \t\t read_blob_object(&buf, pre_sha1, patch->old_mode))\n \t\treturn error(_(\"repository lacks the necessary blob to fall back on 3-way merge.\"));\n \n-\tfprintf(stderr, \"Falling back to three-way merge...\\n\");\n+\tfprintf(stderr, _(\"Falling back to three-way merge...\\n\"));\n \n \timg = strbuf_detach(&buf, &len);\n \tprepare_image(&tmp_image, img, len, 1);\n@@ -3555,7 +3555,7 @@ static int try_threeway(struct apply_state *state,\n \tstatus = three_way_merge(image, patch->new_name,\n \t\t\t\t pre_sha1, our_sha1, post_sha1);\n \tif (status < 0) {\n-\t\tfprintf(stderr, \"Failed to fall back on three-way merge...\\n\");\n+\t\tfprintf(stderr, _(\"Failed to fall back on three-way merge...\\n\"));\n \t\treturn status;\n \t}\n \n@@ -3567,9 +3567,9 @@ static int try_threeway(struct apply_state *state,\n \t\t\thashcpy(patch->threeway_stage[0].hash, pre_sha1);\n \t\thashcpy(patch->threeway_stage[1].hash, our_sha1);\n \t\thashcpy(patch->threeway_stage[2].hash, post_sha1);\n-\t\tfprintf(stderr, \"Applied patch to '%s' with conflicts.\\n\", patch->new_name);\n+\t\tfprintf(stderr, _(\"Applied patch to '%s' with conflicts.\\n\"), patch->new_name);\n \t} else {\n-\t\tfprintf(stderr, \"Applied patch to '%s' cleanly.\\n\", patch->new_name);\n+\t\tfprintf(stderr, _(\"Applied patch to '%s' cleanly.\\n\"), patch->new_name);\n \t}\n \treturn 0;\n }\n-- \n2.7.4\n\n"},{"id":"301707","messageId":"1473679802-31381-5-git-send-email-vascomalmeida@sapo.pt","threadId":"44062","inReplyTo":"1473679802-31381-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v2 05/14] i18n: branch: mark option description for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-12T11:29:53Z","receivedAt":"2016-09-12T11:38:14Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/branch.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex 7df0543..d5d93a8 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -657,7 +657,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \t\tOPT_SET_INT( 0, \"set-upstream\",  &track, N_(\"change upstream info\"),\n \t\t\tBRANCH_TRACK_OVERRIDE),\n \t\tOPT_STRING('u', \"set-upstream-to\", &new_upstream, N_(\"upstream\"), N_(\"change the upstream info\")),\n-\t\tOPT_BOOL(0, \"unset-upstream\", &unset_upstream, \"Unset the upstream info\"),\n+\t\tOPT_BOOL(0, \"unset-upstream\", &unset_upstream, N_(\"Unset the upstream info\")),\n \t\tOPT__COLOR(&branch_use_color, N_(\"use colored output\")),\n \t\tOPT_SET_INT('r', \"remotes\",     &filter.kind, N_(\"act on remote-tracking branches\"),\n \t\t\tFILTER_REFS_REMOTES),\n-- \n2.7.4\n\n"},{"id":"301708","messageId":"1473679802-31381-7-git-send-email-vascomalmeida@sapo.pt","threadId":"44062","inReplyTo":"1473679802-31381-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v2 07/14] i18n: merge-recursive: mark error messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-12T11:29:55Z","receivedAt":"2016-09-12T11:38:17Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Lowercase first word of such error messages following the usual style.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/merge-recursive.c | 14 +++++++-------\n 1 file changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/builtin/merge-recursive.c b/builtin/merge-recursive.c\nindex fd2c455..0bc88a7 100644\n--- a/builtin/merge-recursive.c\n+++ b/builtin/merge-recursive.c\n@@ -42,30 +42,30 @@ int cmd_merge_recursive(int argc, const char **argv, const char *prefix)\n \t\t\tif (!arg[2])\n \t\t\t\tbreak;\n \t\t\tif (parse_merge_opt(&o, arg + 2))\n-\t\t\t\tdie(\"Unknown option %s\", arg);\n+\t\t\t\tdie(_(\"unknown option %s\"), arg);\n \t\t\tcontinue;\n \t\t}\n \t\tif (bases_count < ARRAY_SIZE(bases)-1) {\n \t\t\tstruct object_id *oid = xmalloc(sizeof(struct object_id));\n \t\t\tif (get_oid(argv[i], oid))\n-\t\t\t\tdie(\"Could not parse object '%s'\", argv[i]);\n+\t\t\t\tdie(_(\"could not parse object '%s'\"), argv[i]);\n \t\t\tbases[bases_count++] = oid;\n \t\t}\n \t\telse\n-\t\t\twarning(\"Cannot handle more than %d bases. \"\n-\t\t\t\t\"Ignoring %s.\",\n+\t\t\twarning(_(\"cannot handle more than %d bases. \"\n+\t\t\t\t  \"Ignoring %s.\"),\n \t\t\t\t(int)ARRAY_SIZE(bases)-1, argv[i]);\n \t}\n \tif (argc - i != 3) /* \"--\" \"<head>\" \"<remote>\" */\n-\t\tdie(\"Not handling anything other than two heads merge.\");\n+\t\tdie(_(\"not handling anything other than two heads merge.\"));\n \n \to.branch1 = argv[++i];\n \to.branch2 = argv[++i];\n \n \tif (get_oid(o.branch1, &h1))\n-\t\tdie(\"Could not resolve ref '%s'\", o.branch1);\n+\t\tdie(_(\"could not resolve ref '%s'\"), o.branch1);\n \tif (get_oid(o.branch2, &h2))\n-\t\tdie(\"Could not resolve ref '%s'\", o.branch2);\n+\t\tdie(_(\"could not resolve ref '%s'\"), o.branch2);\n \n \to.branch1 = better_branch_name(o.branch1);\n \to.branch2 = better_branch_name(o.branch2);\n-- \n2.7.4\n\n"},{"id":"301709","messageId":"1473679802-31381-8-git-send-email-vascomalmeida@sapo.pt","threadId":"44062","inReplyTo":"1473679802-31381-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v2 08/14] i18n: merge-recursive: mark verbose message for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-12T11:29:56Z","receivedAt":"2016-09-12T11:38:19Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/merge-recursive.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/builtin/merge-recursive.c b/builtin/merge-recursive.c\nindex 0bc88a7..1c21802 100644\n--- a/builtin/merge-recursive.c\n+++ b/builtin/merge-recursive.c\n@@ -71,7 +71,7 @@ int cmd_merge_recursive(int argc, const char **argv, const char *prefix)\n \to.branch2 = better_branch_name(o.branch2);\n \n \tif (o.verbosity >= 3)\n-\t\tprintf(\"Merging %s with %s\\n\", o.branch1, o.branch2);\n+\t\tprintf(_(\"Merging %s with %s\\n\"), o.branch1, o.branch2);\n \n \tfailed = merge_recursive_generic(&o, &h1, &h2, bases_count, bases, &result);\n \tif (failed < 0)\n-- \n2.7.4\n\n"},{"id":"301710","messageId":"1473679802-31381-9-git-send-email-vascomalmeida@sapo.pt","threadId":"44062","inReplyTo":"1473679802-31381-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v2 09/14] i18n: notes: mark error messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-12T11:29:57Z","receivedAt":"2016-09-12T11:38:24Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/notes.c | 18 +++++++++---------\n 1 file changed, 9 insertions(+), 9 deletions(-)\n\ndiff --git a/builtin/notes.c b/builtin/notes.c\nindex f848b89..abacae2 100644\n--- a/builtin/notes.c\n+++ b/builtin/notes.c\n@@ -340,7 +340,7 @@ static struct notes_tree *init_notes_check(const char *subcommand,\n \n \tref = (flags & NOTES_INIT_WRITABLE) ? t->update_ref : t->ref;\n \tif (!starts_with(ref, \"refs/notes/\"))\n-\t\tdie(\"Refusing to %s notes in %s (outside of refs/notes/)\",\n+\t\tdie(_(\"Refusing to %s notes in %s (outside of refs/notes/)\"),\n \t\t    subcommand, ref);\n \treturn t;\n }\n@@ -680,11 +680,11 @@ static int merge_abort(struct notes_merge_options *o)\n \t */\n \n \tif (delete_ref(\"NOTES_MERGE_PARTIAL\", NULL, 0))\n-\t\tret += error(\"Failed to delete ref NOTES_MERGE_PARTIAL\");\n+\t\tret += error(_(\"Failed to delete ref NOTES_MERGE_PARTIAL\"));\n \tif (delete_ref(\"NOTES_MERGE_REF\", NULL, REF_NODEREF))\n-\t\tret += error(\"Failed to delete ref NOTES_MERGE_REF\");\n+\t\tret += error(_(\"Failed to delete ref NOTES_MERGE_REF\"));\n \tif (notes_merge_abort(o))\n-\t\tret += error(\"Failed to remove 'git notes merge' worktree\");\n+\t\tret += error(_(\"Failed to remove 'git notes merge' worktree\"));\n \treturn ret;\n }\n \n@@ -704,11 +704,11 @@ static int merge_commit(struct notes_merge_options *o)\n \t */\n \n \tif (get_sha1(\"NOTES_MERGE_PARTIAL\", sha1))\n-\t\tdie(\"Failed to read ref NOTES_MERGE_PARTIAL\");\n+\t\tdie(_(\"Failed to read ref NOTES_MERGE_PARTIAL\"));\n \telse if (!(partial = lookup_commit_reference(sha1)))\n-\t\tdie(\"Could not find commit from NOTES_MERGE_PARTIAL.\");\n+\t\tdie(_(\"Could not find commit from NOTES_MERGE_PARTIAL.\"));\n \telse if (parse_commit(partial))\n-\t\tdie(\"Could not parse commit from NOTES_MERGE_PARTIAL.\");\n+\t\tdie(_(\"Could not parse commit from NOTES_MERGE_PARTIAL.\"));\n \n \tif (partial->parents)\n \t\thashcpy(parent_sha1, partial->parents->item->object.oid.hash);\n@@ -721,10 +721,10 @@ static int merge_commit(struct notes_merge_options *o)\n \to->local_ref = local_ref_to_free =\n \t\tresolve_refdup(\"NOTES_MERGE_REF\", 0, sha1, NULL);\n \tif (!o->local_ref)\n-\t\tdie(\"Failed to resolve NOTES_MERGE_REF\");\n+\t\tdie(_(\"Failed to resolve NOTES_MERGE_REF\"));\n \n \tif (notes_merge_commit(o, t, partial, sha1))\n-\t\tdie(\"Failed to finalize notes merge\");\n+\t\tdie(_(\"Failed to finalize notes merge\"));\n \n \t/* Reuse existing commit message in reflog message */\n \tmemset(&pretty_ctx, 0, sizeof(pretty_ctx));\n-- \n2.7.4\n\n"},{"id":"301711","messageId":"1473679802-31381-12-git-send-email-vascomalmeida@sapo.pt","threadId":"44062","inReplyTo":"1473679802-31381-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v2 12/14] i18n: show-branch: mark error messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-12T11:30:00Z","receivedAt":"2016-09-12T11:38:40Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Lowercase some messages first word to match style of the others.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/show-branch.c | 18 +++++++++---------\n 1 file changed, 9 insertions(+), 9 deletions(-)\n\ndiff --git a/builtin/show-branch.c b/builtin/show-branch.c\nindex 2566935..6bf82cd 100644\n--- a/builtin/show-branch.c\n+++ b/builtin/show-branch.c\n@@ -538,7 +538,7 @@ static void append_one_rev(const char *av)\n \t\tfor_each_ref(append_matching_ref, NULL);\n \t\tif (saved_matches == ref_name_cnt &&\n \t\t    ref_name_cnt < MAX_REVS)\n-\t\t\terror(\"no matching refs with %s\", av);\n+\t\t\terror(_(\"no matching refs with %s\"), av);\n \t\tif (saved_matches + 1 < ref_name_cnt)\n \t\t\tsort_ref_range(saved_matches, ref_name_cnt);\n \t\treturn;\n@@ -701,8 +701,8 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)\n \t\t\t *\n \t\t\t * Also --all and --remotes do not make sense either.\n \t\t\t */\n-\t\t\tdie(\"--reflog is incompatible with --all, --remotes, \"\n-\t\t\t    \"--independent or --merge-base\");\n+\t\t\tdie(_(\"--reflog is incompatible with --all, --remotes, \"\n+\t\t\t      \"--independent or --merge-base\"));\n \t}\n \n \t/* If nothing is specified, show all branches by default */\n@@ -725,16 +725,16 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)\n \t\t\tav = fake_av;\n \t\t\tac = 1;\n \t\t\tif (!*av)\n-\t\t\t\tdie(\"no branches given, and HEAD is not valid\");\n+\t\t\t\tdie(_(\"no branches given, and HEAD is not valid\"));\n \t\t}\n \t\tif (ac != 1)\n-\t\t\tdie(\"--reflog option needs one branch name\");\n+\t\t\tdie(_(\"--reflog option needs one branch name\"));\n \n \t\tif (MAX_REVS < reflog)\n-\t\t\tdie(\"Only %d entries can be shown at one time.\",\n+\t\t\tdie(\"only %d entries can be shown at one time.\",\n \t\t\t    MAX_REVS);\n \t\tif (!dwim_ref(*av, strlen(*av), oid.hash, &ref))\n-\t\t\tdie(\"No such ref %s\", *av);\n+\t\t\tdie(_(\"no such ref %s\"), *av);\n \n \t\t/* Has the base been specified? */\n \t\tif (reflog_base) {\n@@ -828,10 +828,10 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)\n \t\tif (MAX_REVS <= num_rev)\n \t\t\tdie(\"cannot handle more than %d revs.\", MAX_REVS);\n \t\tif (get_sha1(ref_name[num_rev], revkey.hash))\n-\t\t\tdie(\"'%s' is not a valid ref.\", ref_name[num_rev]);\n+\t\t\tdie(_(\"'%s' is not a valid ref.\"), ref_name[num_rev]);\n \t\tcommit = lookup_commit_reference(revkey.hash);\n \t\tif (!commit)\n-\t\t\tdie(\"cannot find commit %s (%s)\",\n+\t\t\tdie(_(\"cannot find commit %s (%s)\"),\n \t\t\t    ref_name[num_rev], oid_to_hex(&revkey));\n \t\tparse_commit(commit);\n \t\tmark_seen(commit, &seen);\n-- \n2.7.4\n\n"},{"id":"301712","messageId":"1473679802-31381-11-git-send-email-vascomalmeida@sapo.pt","threadId":"44062","inReplyTo":"1473679802-31381-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v2 11/14] i18n: receive-pack: mark messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-12T11:29:59Z","receivedAt":"2016-09-12T11:38:45Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark messages refuse_unconfigured_deny_msg and\nrefuse_unconfigured_deny_delete_current_msg for translation.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/receive-pack.c | 58 ++++++++++++++++++++++----------------------------\n 1 file changed, 25 insertions(+), 33 deletions(-)\n\ndiff --git a/builtin/receive-pack.c b/builtin/receive-pack.c\nindex f1ce05c..896b16f 100644\n--- a/builtin/receive-pack.c\n+++ b/builtin/receive-pack.c\n@@ -781,47 +781,39 @@ static int is_ref_checked_out(const char *ref)\n \treturn !strcmp(head_name, ref);\n }\n \n-static char *refuse_unconfigured_deny_msg[] = {\n-\t\"By default, updating the current branch in a non-bare repository\",\n-\t\"is denied, because it will make the index and work tree inconsistent\",\n-\t\"with what you pushed, and will require 'git reset --hard' to match\",\n-\t\"the work tree to HEAD.\",\n-\t\"\",\n-\t\"You can set 'receive.denyCurrentBranch' configuration variable to\",\n-\t\"'ignore' or 'warn' in the remote repository to allow pushing into\",\n-\t\"its current branch; however, this is not recommended unless you\",\n-\t\"arranged to update its work tree to match what you pushed in some\",\n-\t\"other way.\",\n-\t\"\",\n-\t\"To squelch this message and still keep the default behaviour, set\",\n-\t\"'receive.denyCurrentBranch' configuration variable to 'refuse'.\"\n-};\n+static char *refuse_unconfigured_deny_msg =\n+\tN_(\"By default, updating the current branch in a non-bare repository\\n\"\n+\t   \"is denied, because it will make the index and work tree inconsistent\\n\"\n+\t   \"with what you pushed, and will require 'git reset --hard' to match\\n\"\n+\t   \"the work tree to HEAD.\\n\"\n+\t   \"\\n\"\n+\t   \"You can set 'receive.denyCurrentBranch' configuration variable to\\n\"\n+\t   \"'ignore' or 'warn' in the remote repository to allow pushing into\\n\"\n+\t   \"its current branch; however, this is not recommended unless you\\n\"\n+\t   \"arranged to update its work tree to match what you pushed in some\\n\"\n+\t   \"other way.\\n\"\n+\t   \"\\n\"\n+\t   \"To squelch this message and still keep the default behaviour, set\\n\"\n+\t   \"'receive.denyCurrentBranch' configuration variable to 'refuse'.\");\n \n static void refuse_unconfigured_deny(void)\n {\n-\tint i;\n-\tfor (i = 0; i < ARRAY_SIZE(refuse_unconfigured_deny_msg); i++)\n-\t\trp_error(\"%s\", refuse_unconfigured_deny_msg[i]);\n+\trp_error(\"%s\", _(refuse_unconfigured_deny_msg));\n }\n \n-static char *refuse_unconfigured_deny_delete_current_msg[] = {\n-\t\"By default, deleting the current branch is denied, because the next\",\n-\t\"'git clone' won't result in any file checked out, causing confusion.\",\n-\t\"\",\n-\t\"You can set 'receive.denyDeleteCurrent' configuration variable to\",\n-\t\"'warn' or 'ignore' in the remote repository to allow deleting the\",\n-\t\"current branch, with or without a warning message.\",\n-\t\"\",\n-\t\"To squelch this message, you can set it to 'refuse'.\"\n-};\n+static char *refuse_unconfigured_deny_delete_current_msg =\n+\tN_(\"By default, deleting the current branch is denied, because the next\\n\"\n+\t   \"'git clone' won't result in any file checked out, causing confusion.\\n\"\n+\t   \"\\n\"\n+\t   \"You can set 'receive.denyDeleteCurrent' configuration variable to\\n\"\n+\t   \"'warn' or 'ignore' in the remote repository to allow deleting the\\n\"\n+\t   \"current branch, with or without a warning message.\\n\"\n+\t   \"\\n\"\n+\t   \"To squelch this message, you can set it to 'refuse'.\");\n \n static void refuse_unconfigured_deny_delete_current(void)\n {\n-\tint i;\n-\tfor (i = 0;\n-\t     i < ARRAY_SIZE(refuse_unconfigured_deny_delete_current_msg);\n-\t     i++)\n-\t\trp_error(\"%s\", refuse_unconfigured_deny_delete_current_msg[i]);\n+\trp_error(\"%s\", _(refuse_unconfigured_deny_delete_current_msg));\n }\n \n static int command_singleton_iterator(void *cb_data, unsigned char sha1[20]);\n-- \n2.7.4\n\n"},{"id":"301713","messageId":"1473679802-31381-13-git-send-email-vascomalmeida@sapo.pt","threadId":"44062","inReplyTo":"1473679802-31381-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v2 13/14] i18n: update-index: mark warnings for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-12T11:30:01Z","receivedAt":"2016-09-12T11:38:49Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/update-index.c | 12 ++++++------\n 1 file changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/builtin/update-index.c b/builtin/update-index.c\nindex ba04b19..7a17ce1 100644\n--- a/builtin/update-index.c\n+++ b/builtin/update-index.c\n@@ -1127,9 +1127,9 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)\n \t\tbreak;\n \tcase UC_DISABLE:\n \t\tif (git_config_get_untracked_cache() == 1)\n-\t\t\twarning(\"core.untrackedCache is set to true; \"\n-\t\t\t\t\"remove or change it, if you really want to \"\n-\t\t\t\t\"disable the untracked cache\");\n+\t\t\twarning(_(\"core.untrackedCache is set to true; \"\n+\t\t\t\t  \"remove or change it, if you really want to \"\n+\t\t\t\t  \"disable the untracked cache\"));\n \t\tremove_untracked_cache(&the_index);\n \t\treport(_(\"Untracked cache disabled\"));\n \t\tbreak;\n@@ -1139,9 +1139,9 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)\n \tcase UC_ENABLE:\n \tcase UC_FORCE:\n \t\tif (git_config_get_untracked_cache() == 0)\n-\t\t\twarning(\"core.untrackedCache is set to false; \"\n-\t\t\t\t\"remove or change it, if you really want to \"\n-\t\t\t\t\"enable the untracked cache\");\n+\t\t\twarning(_(\"core.untrackedCache is set to false; \"\n+\t\t\t\t  \"remove or change it, if you really want to \"\n+\t\t\t\t  \"enable the untracked cache\"));\n \t\tadd_untracked_cache(&the_index);\n \t\treport(_(\"Untracked cache enabled for '%s'\"), get_git_work_tree());\n \t\tbreak;\n-- \n2.7.4\n\n"},{"id":"301714","messageId":"1473679802-31381-14-git-send-email-vascomalmeida@sapo.pt","threadId":"44062","inReplyTo":"1473679802-31381-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v2 14/14] i18n: show-branch: mark plural strings for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-12T11:30:02Z","receivedAt":"2016-09-12T11:39:04Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark plural string for translation using Q_().\n\nAlthough we already know that the plural sentence is always used in the\nEnglish source, other languages have complex plural rules they must\ncomply according to the value of MAX_REVS.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/show-branch.c | 15 ++++++++++-----\n 1 file changed, 10 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin/show-branch.c b/builtin/show-branch.c\nindex 6bf82cd..5905ca1 100644\n--- a/builtin/show-branch.c\n+++ b/builtin/show-branch.c\n@@ -373,8 +373,9 @@ static int append_ref(const char *refname, const struct object_id *oid,\n \t\t\t\treturn 0;\n \t}\n \tif (MAX_REVS <= ref_name_cnt) {\n-\t\twarning(\"ignoring %s; cannot handle more than %d refs\",\n-\t\t\trefname, MAX_REVS);\n+\t\twarning(Q_(\"ignoring %s; cannot handle more than %d ref\",\n+\t\t\t   \"ignoring %s; cannot handle more than %d refs\",\n+\t\t\t   MAX_REVS), refname, MAX_REVS);\n \t\treturn 0;\n \t}\n \tref_name[ref_name_cnt++] = xstrdup(refname);\n@@ -731,8 +732,9 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)\n \t\t\tdie(_(\"--reflog option needs one branch name\"));\n \n \t\tif (MAX_REVS < reflog)\n-\t\t\tdie(\"only %d entries can be shown at one time.\",\n-\t\t\t    MAX_REVS);\n+\t\t\tdie(Q_(\"only %d entry can be shown at one time.\",\n+\t\t\t       \"only %d entries can be shown at one time.\",\n+\t\t\t       MAX_REVS), MAX_REVS);\n \t\tif (!dwim_ref(*av, strlen(*av), oid.hash, &ref))\n \t\t\tdie(_(\"no such ref %s\"), *av);\n \n@@ -826,7 +828,10 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)\n \t\tunsigned int flag = 1u << (num_rev + REV_SHIFT);\n \n \t\tif (MAX_REVS <= num_rev)\n-\t\t\tdie(\"cannot handle more than %d revs.\", MAX_REVS);\n+\t\t\tdie(Q_(\"cannot handle more than %d rev.\",\n+\t\t\t       \"cannot handle more than %d revs.\",\n+\t\t\t       MAX_REVS), MAX_REVS);\n+\t\tif (get_sha1(ref_name[num_rev], revkey.hash))\n \t\tif (get_sha1(ref_name[num_rev], revkey.hash))\n \t\t\tdie(_(\"'%s' is not a valid ref.\"), ref_name[num_rev]);\n \t\tcommit = lookup_commit_reference(revkey.hash);\n-- \n2.7.4\n\n"},{"id":"301715","messageId":"882dcaf3-fd9b-0d83-2756-f3315dd6bb4e@gmail.com","threadId":"44062","inReplyTo":"1473679802-31381-7-git-send-email-vascomalmeida@sapo.pt","subject":"Re: [PATCH v2 07/14] i18n: merge-recursive: mark error messages for translation","fromName":"Jean-Noël Avila","fromEmail":"avila.jn@gmail.com","sentAt":"2016-09-12T11:47:43Z","receivedAt":"2016-09-12T11:47:52Z","isPatch":true,"sender":{"key":"jn.avila@free.fr","avatar":"https://avatars.githubusercontent.com/u/156172?v=4"},"body":"Hi,\n\nLe 12/09/2016 à 13:29, Vasco Almeida a écrit :\n> -\t\t\twarning(\"Cannot handle more than %d bases. \"\n> -\t\t\t\t\"Ignoring %s.\",\n> +\t\t\twarning(_(\"cannot handle more than %d bases. \"\n> +\t\t\t\t  \"Ignoring %s.\"),\n>  \t\t\t\t(int)ARRAY_SIZE(bases)-1, argv[i]);\n>  \t}\n\nThis one is also missing the plural form.\n\nThanks,\n\nJN\n"},{"id":"301718","messageId":"ba3430ff-9643-eddb-31e7-c1e9a399d806@free.fr","threadId":"44062","inReplyTo":"1473679802-31381-12-git-send-email-vascomalmeida@sapo.pt","subject":"Re: [PATCH v2 12/14] i18n: show-branch: mark error messages for translation","fromName":"Jean-Noël Avila","fromEmail":"jn.avila@free.fr","sentAt":"2016-09-12T12:12:25Z","receivedAt":"2016-09-12T12:12:42Z","isPatch":true,"sender":{"key":"jn.avila@free.fr","avatar":"https://avatars.githubusercontent.com/u/156172?v=4"},"body":"Le 12/09/2016 à 13:30, Vasco Almeida a écrit :\n>  \t\tif (MAX_REVS < reflog)\n> -\t\t\tdie(\"Only %d entries can be shown at one time.\",\n> +\t\t\tdie(\"only %d entries can be shown at one time.\",\n>  \t\t\t    MAX_REVS);\n\nWouldn't you i18n this one too, with plural form?\n\n\nJN\n"},{"id":"301719","messageId":"83f72924-9a9d-dc1c-109f-341f0cd7ac96@free.fr","threadId":"44062","inReplyTo":"1473679802-31381-9-git-send-email-vascomalmeida@sapo.pt","subject":"Re: [PATCH v2 09/14] i18n: notes: mark error messages for translation","fromName":"Jean-Noël Avila","fromEmail":"jn.avila@free.fr","sentAt":"2016-09-12T12:23:02Z","receivedAt":"2016-09-12T12:23:18Z","isPatch":true,"sender":{"key":"jn.avila@free.fr","avatar":"https://avatars.githubusercontent.com/u/156172?v=4"},"body":"Le 12/09/2016 à 13:29, Vasco Almeida a écrit :\n> Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n> ---\n>  builtin/notes.c | 18 +++++++++---------\n>  1 file changed, 9 insertions(+), 9 deletions(-)\n>\n> diff --git a/builtin/notes.c b/builtin/notes.c\n> index f848b89..abacae2 100644\n> --- a/builtin/notes.c\n> +++ b/builtin/notes.c\n> @@ -340,7 +340,7 @@ static struct notes_tree *init_notes_check(const char *subcommand,\n>  \n>  \tref = (flags & NOTES_INIT_WRITABLE) ? t->update_ref : t->ref;\n>  \tif (!starts_with(ref, \"refs/notes/\"))\n> -\t\tdie(\"Refusing to %s notes in %s (outside of refs/notes/)\",\n> +\t\tdie(_(\"Refusing to %s notes in %s (outside of refs/notes/)\"),\n>  \t\t    subcommand, ref);\n>  \treturn t;\n>  }\n\nNot sure this one will be easy to localize. The verb is passed as a\nparameter : see line 366 \"list\", line 426 \"add\", line 517 \"copy\", line\n658 \"show\", line 816 \"merge\", line 908 \"remove\" or line 595 with argv[0].\n\nIf all the verbs are real subcommands, then the translators should be\nwarned that this is some english twisting, but that they need to refer\nto the subcommand on the command line.\n\nOtherwise,\n\nAcked-by: Jean-Noël Avila <jean-noel.avila@free.fr>\n\nJN\n"},{"id":"301727","messageId":"xmqqinu13y0x.fsf@gitster.mtv.corp.google.com","threadId":"44062","inReplyTo":"1473679802-31381-7-git-send-email-vascomalmeida@sapo.pt","subject":"Re: [PATCH v2 07/14] i18n: merge-recursive: mark error messages for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-09-12T16:04:14Z","receivedAt":"2016-09-12T16:04:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Vasco Almeida <vascomalmeida@sapo.pt> writes:\n\n> Lowercase first word of such error messages following the usual style.\n\n\"Change X to lowercase\" is fine, but \"Lowercase\" is not a verb.\n\nReword it to \"Downcase the first word...\", perhaps (not limited to\nthis step).\n"},{"id":"301729","messageId":"xmqqeg4p3vdb.fsf@gitster.mtv.corp.google.com","threadId":"44062","inReplyTo":"882dcaf3-fd9b-0d83-2756-f3315dd6bb4e@gmail.com","subject":"Re: [PATCH v2 07/14] i18n: merge-recursive: mark error messages for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-09-12T17:01:36Z","receivedAt":"2016-09-12T17:02:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jean-Noël Avila <avila.jn@gmail.com> writes:\n\n> Le 12/09/2016 à 13:29, Vasco Almeida a écrit :\n>> -\t\t\twarning(\"Cannot handle more than %d bases. \"\n>> -\t\t\t\t\"Ignoring %s.\",\n>> +\t\t\twarning(_(\"cannot handle more than %d bases. \"\n>> +\t\t\t\t  \"Ignoring %s.\"),\n>>  \t\t\t\t(int)ARRAY_SIZE(bases)-1, argv[i]);\n>>  \t}\n>\n> This one is also missing the plural form.\n\nThat is technically correct, but I do not think it matters, as we\nwon't be making bases[] array smaller than it currently is, so the\n\"more than %d bases\" part of the message will always be in the\nplural form and never be singular.\n\nThanks.\n\n"},{"id":"301730","messageId":"xmqqa8fd3vb5.fsf@gitster.mtv.corp.google.com","threadId":"44062","inReplyTo":"ba3430ff-9643-eddb-31e7-c1e9a399d806@free.fr","subject":"Re: [PATCH v2 12/14] i18n: show-branch: mark error messages for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-09-12T17:02:54Z","receivedAt":"2016-09-12T17:03:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jean-Noël Avila <jn.avila@free.fr> writes:\n\n> Le 12/09/2016 à 13:30, Vasco Almeida a écrit :\n>>  \t\tif (MAX_REVS < reflog)\n>> -\t\t\tdie(\"Only %d entries can be shown at one time.\",\n>> +\t\t\tdie(\"only %d entries can be shown at one time.\",\n>>  \t\t\t    MAX_REVS);\n>\n> Wouldn't you i18n this one too, with plural form?\n\nI would think this one is OK in practice for the same reason as 7/14\n"},{"id":"301732","messageId":"17140652.xHVhzLXte8@cayenne","threadId":"44062","inReplyTo":"xmqqa8fd3vb5.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v2 12/14] i18n: show-branch: mark error messages for translation","fromName":"Jean-Noël AVILA","fromEmail":"jn.avila@free.fr","sentAt":"2016-09-12T17:19:55Z","receivedAt":"2016-09-12T17:20:18Z","isPatch":true,"sender":{"key":"jn.avila@free.fr","avatar":"https://avatars.githubusercontent.com/u/156172?v=4"},"body":"On lundi 12 septembre 2016 10:02:54 CEST Junio C Hamano wrote:\n> Jean-Noël Avila <jn.avila@free.fr> writes:\n> > Le 12/09/2016 à 13:30, Vasco Almeida a écrit :\n> >>  \t\tif (MAX_REVS < reflog)\n> >> \n> >> -\t\t\tdie(\"Only %d entries can be shown at one time.\",\n> >> +\t\t\tdie(\"only %d entries can be shown at one time.\",\n> >> \n> >>  \t\t\t    MAX_REVS);\n> > \n> > Wouldn't you i18n this one too, with plural form?\n> \n> I would think this one is OK in practice for the same reason as 7/14\n\nI would think the contrary for the same reason as 14/14 \n\nWe don't know the actual value of MAX_REVS at the time we translate, and \nplural forms can be quite different depending on its value. See for instance \npolish:\n\nhttps://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html\n\nOf course, too bad, we only use one of the forms but I don't see any \nalternative.\n\nThanks,\n\nJN\n\n"},{"id":"301761","messageId":"xmqqlgywzw08.fsf@gitster.mtv.corp.google.com","threadId":"44062","inReplyTo":"17140652.xHVhzLXte8@cayenne","subject":"Re: [PATCH v2 12/14] i18n: show-branch: mark error messages for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-09-12T20:46:47Z","receivedAt":"2016-09-12T20:46:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jean-Noël AVILA <jn.avila@free.fr> writes:\n\n> ..., and \n> plural forms can be quite different depending on its value.\n\nAHHhhh, of course you are right.\n"},{"id":"301851","messageId":"1473784505.7329.18.camel@sapo.pt","threadId":"44062","inReplyTo":"83f72924-9a9d-dc1c-109f-341f0cd7ac96@free.fr","subject":"Re: [PATCH v2 09/14] i18n: notes: mark error messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-13T16:35:05Z","receivedAt":"2016-09-13T16:35:23Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"A Seg, 12-09-2016 às 14:23 +0200, Jean-Noël Avila escreveu:\n> Le 12/09/2016 à 13:29, Vasco Almeida a écrit :\n> > \n> > Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n> > ---\n> >  builtin/notes.c | 18 +++++++++---------\n> >  1 file changed, 9 insertions(+), 9 deletions(-)\n> > \n> > diff --git a/builtin/notes.c b/builtin/notes.c\n> > index f848b89..abacae2 100644\n> > --- a/builtin/notes.c\n> > +++ b/builtin/notes.c\n> > @@ -340,7 +340,7 @@ static struct notes_tree\n> > *init_notes_check(const char *subcommand,\n> >  \n> >  \tref = (flags & NOTES_INIT_WRITABLE) ? t->update_ref : t-\n> > >ref;\n> >  \tif (!starts_with(ref, \"refs/notes/\"))\n> > -\t\tdie(\"Refusing to %s notes in %s (outside of\n> > refs/notes/)\",\n> > +\t\tdie(_(\"Refusing to %s notes in %s (outside of\n> > refs/notes/)\"),\n> >  \t\t    subcommand, ref);\n> >  \treturn t;\n> >  }\n> \n> Not sure this one will be easy to localize. The verb is passed as a\n> parameter : see line 366 \"list\", line 426 \"add\", line 517 \"copy\",\n> line\n> 658 \"show\", line 816 \"merge\", line 908 \"remove\" or line 595 with\n> argv[0].\n> \n> If all the verbs are real subcommands, then the translators should be\n> warned that this is some english twisting, but that they need to\n> refer\n> to the subcommand on the command line.\n\nYes, these verbs are git notes subcommands. I will add a Translators\ncomment to it explaining so. Or we can unfold that error messages like\n\nif (!strcmp(subcommand, \"add\")\n\tdie(_(\"Refusing to add notes in %s (outside of refs/notes/)\"),\nref);\nelseif ...\n\nelse\n\tdie(_(\"Refusing to %s notes in %s (outside of refs/notes/)\"),\nsubcommand, ref);\n\nThis is more verbose but translations would benefit from it being more\nnatural. What do we prefer: (1) concise source and a little unnatural\ntranslations or (2) verbose code and natural translations?\n\nCompare, imaging that English is a target translation language, the\nuser would read:\n\"Refusing to do add of notes in /path [...]\" (1)\n\"Refusing do add notes in /path [...]\" (2)\n\n> Otherwise,\n> \n> Acked-by: Jean-Noël Avila <jean-noel.avila@free.fr>\n> \n> JN\n"},{"id":"301856","messageId":"1473785665.7329.22.camel@sapo.pt","threadId":"44062","inReplyTo":"xmqqinu13y0x.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v2 07/14] i18n: merge-recursive: mark error messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-13T16:54:25Z","receivedAt":"2016-09-13T16:55:38Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"A Seg, 12-09-2016 às 09:04 -0700, Junio C Hamano escreveu:\n> Vasco Almeida <vascomalmeida@sapo.pt> writes:\n> \n> > \n> > Lowercase first word of such error messages following the usual\n> > style.\n> \n> \"Change X to lowercase\" is fine, but \"Lowercase\" is not a verb.\n> \n> Reword it to \"Downcase the first word...\", perhaps (not limited to\n> this step).\n\nLowercase is a verb [1] meaning to print or write with a lowercase\nletter or letters. Knowing that can the commit message be kept?\n\n[1] http://www.dictionary.com/browse/lowercase\n"},{"id":"301867","messageId":"2523910.zLOPm9a3mF@cayenne","threadId":"44062","inReplyTo":"1473784505.7329.18.camel@sapo.pt","subject":"Re: [PATCH v2 09/14] i18n: notes: mark error messages for translation","fromName":"Jean-Noël AVILA","fromEmail":"jn.avila@free.fr","sentAt":"2016-09-13T20:23:07Z","receivedAt":"2016-09-13T20:23:20Z","isPatch":true,"sender":{"key":"jn.avila@free.fr","avatar":"https://avatars.githubusercontent.com/u/156172?v=4"},"body":"On mardi 13 septembre 2016 16:35:05 CEST Vasco Almeida wrote:\n> A Seg, 12-09-2016 às 14:23 +0200, Jean-Noël Avila escreveu:\n> > Not sure this one will be easy to localize. The verb is passed as a\n> > parameter : see line 366 \"list\", line 426 \"add\", line 517 \"copy\",\n> > line\n> > 658 \"show\", line 816 \"merge\", line 908 \"remove\" or line 595 with\n> > argv[0].\n> > \n> > If all the verbs are real subcommands, then the translators should be\n> > warned that this is some english twisting, but that they need to\n> > refer\n> > to the subcommand on the command line.\n> \n> Yes, these verbs are git notes subcommands. I will add a Translators\n> comment to it explaining so. Or we can unfold that error messages like\n> \n> if (!strcmp(subcommand, \"add\")\n> \tdie(_(\"Refusing to add notes in %s (outside of refs/notes/)\"),\n> ref);\n> elseif ...\n> \n> else\n> \tdie(_(\"Refusing to %s notes in %s (outside of refs/notes/)\"),\n> subcommand, ref);\n\nThis would be counter productive to use the inject strings as keys just to \ntest them just after.\n\n> \n> This is more verbose but translations would benefit from it being more\n> natural. What do we prefer: (1) concise source and a little unnatural\n> translations or (2) verbose code and natural translations?\n> \n> Compare, imaging that English is a target translation language, the\n> user would read:\n> \"Refusing to do add of notes in /path [...]\" (1)\n> \"Refusing do add notes in /path [...]\" (2)\n\nHaving one sentence per action is cumbersome, but avoiding sentence lego is \nmandatory for proper i18n. How about  just adding quotes around the subcommand \nand warn translators ? \n\n\n\n\n"},{"id":"301873","messageId":"xmqqfup3v4rg.fsf@gitster.mtv.corp.google.com","threadId":"44062","inReplyTo":"2523910.zLOPm9a3mF@cayenne","subject":"Re: [PATCH v2 09/14] i18n: notes: mark error messages for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-09-13T22:01:07Z","receivedAt":"2016-09-13T22:01:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jean-Noël AVILA <jn.avila@free.fr> writes:\n\n>> Yes, these verbs are git notes subcommands....\n>\n> Having one sentence per action is cumbersome, but avoiding sentence lego is \n> mandatory for proper i18n. How about  just adding quotes around the subcommand \n> and warn translators ? \n\nI think that is a sensible way to go.  I do not think it adds value\nto \"translate\" the action names that needs to be typed verbatim in\nthe message.\n\n"}]}