{"thread":{"id":"44032","subject":"[PATCH 01/13] i18n: apply: mark plural string for translation","startedAt":"2016-09-07T14:50:37Z","lastAt":"2016-09-15T20:19:08Z","messageCount":34,"participants":["Vasco Almeida","Junio C Hamano","Jean-Noël AVILA"],"isPatch":true,"patchVersion":1,"patchTotal":13},"messages":[{"id":"301265","messageId":"1473259758-11836-1-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":null,"subject":"[PATCH 01/13] i18n: apply: mark plural string for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-07T14:49:05Z","receivedAt":"2016-09-07T14:50:37Z","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":"301266","messageId":"1473259758-11836-3-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473259758-11836-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 03/13] i18n: apply: mark info messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-07T14:49:07Z","receivedAt":"2016-09-07T14:50:41Z","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":"301267","messageId":"1473259758-11836-2-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473259758-11836-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 02/13] i18n: apply: mark error messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-07T14:49:06Z","receivedAt":"2016-09-07T14:50:42Z","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":"301268","messageId":"1473259758-11836-4-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473259758-11836-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 04/13] i18n: blame: mark error messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-07T14:49:08Z","receivedAt":"2016-09-07T14:50:51Z","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               | 12 ++++++------\n t/t8003-blame-corner-cases.sh |  4 ++--\n 2 files changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/builtin/blame.c b/builtin/blame.c\nindex a5bbf91..3fee197 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@@ -2820,7 +2820,7 @@ 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(_(\"file %s has only %lu lines\"), 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":"301269","messageId":"1473259758-11836-5-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473259758-11836-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 05/13] i18n: branch: mark option description for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-07T14:49:09Z","receivedAt":"2016-09-07T14:50:54Z","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":"301270","messageId":"1473259758-11836-11-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473259758-11836-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 11/13] i18n: receive-pack: mark messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-07T14:49:15Z","receivedAt":"2016-09-07T14:51:20Z","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 011db00..79839d0 100644\n--- a/builtin/receive-pack.c\n+++ b/builtin/receive-pack.c\n@@ -775,47 +775,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":"301271","messageId":"1473259758-11836-13-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473259758-11836-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 13/13] i18n: update-index: mark warning for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-07T14:49:17Z","receivedAt":"2016-09-07T14:51: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/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":"301272","messageId":"1473259758-11836-12-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473259758-11836-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 12/13] i18n: show-branch: mark error messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-07T14:49:16Z","receivedAt":"2016-09-07T14:51:25Z","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..8a5097d 100644\n--- a/builtin/show-branch.c\n+++ b/builtin/show-branch.c\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@@ -826,12 +826,12 @@ 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(_(\"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":"301273","messageId":"1473259758-11836-9-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473259758-11836-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 09/13] i18n: notes: mark error messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-07T14:49:13Z","receivedAt":"2016-09-07T14:51:51Z","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":"301274","messageId":"1473259758-11836-14-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473259758-11836-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 13/13] i18n: update-index: mark warnings for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-07T14:49:18Z","receivedAt":"2016-09-07T14:51:53Z","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":"301275","messageId":"1473259758-11836-10-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473259758-11836-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 10/13] notes: lowercase first word of error messages","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-07T14:49:14Z","receivedAt":"2016-09-07T14:51:55Z","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":"301276","messageId":"1473259758-11836-8-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473259758-11836-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 08/13] i18n: merge-recursive: mark verbose message for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-07T14:49:12Z","receivedAt":"2016-09-07T14:52:15Z","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":"301277","messageId":"1473259758-11836-6-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473259758-11836-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 06/13] i18n: config: mark error message for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-07T14:49:10Z","receivedAt":"2016-09-07T14:52:18Z","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":"301278","messageId":"1473259758-11836-7-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473259758-11836-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 07/13] i18n: merge-recursive: mark error messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-07T14:49:11Z","receivedAt":"2016-09-07T14:52:22Z","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":"301446","messageId":"xmqqtwdqf7dj.fsf@gitster.mtv.corp.google.com","threadId":"44032","inReplyTo":"1473259758-11836-1-git-send-email-vascomalmeida@sapo.pt","subject":"Re: [PATCH 01/13] i18n: apply: mark plural string for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-09-08T20:45:28Z","receivedAt":"2016-09-08T20:45:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.\n\nI'll skip 01-03/13 and queue the remainder for now, as I'd want to\nsee Christian's \"split builtin/apply.c into two, moving bulk to\napply.c at the top-level to be reused\" merged to 'next' sooner and\nto 'master' hopefully during this cycle.\n\n\n\n\n\n"},{"id":"301545","messageId":"xmqqbmzwc1y7.fsf@gitster.mtv.corp.google.com","threadId":"44032","inReplyTo":"1473259758-11836-7-git-send-email-vascomalmeida@sapo.pt","subject":"Re: [PATCH 07/13] i18n: merge-recursive: mark error messages for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-09-09T19:23:12Z","receivedAt":"2016-09-09T19:23:21Z","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\nI'd reword it to \"Downcase the first word...\".\n\nOther than that all 04-13/13 looked fine to me.\n\nThanks.\n"},{"id":"301595","messageId":"2532042.KMOOJ8STkh@cayenne","threadId":"44032","inReplyTo":"1473259758-11836-4-git-send-email-vascomalmeida@sapo.pt","subject":"Re: [PATCH 04/13] i18n: blame: mark error messages for translation","fromName":"Jean-Noël AVILA","fromEmail":"jn.avila@free.fr","sentAt":"2016-09-10T09:41:28Z","receivedAt":"2016-09-10T09:41:42Z","isPatch":true,"sender":{"key":"jn.avila@free.fr","avatar":"https://avatars.githubusercontent.com/u/156172?v=4"},"body":"On mercredi 7 septembre 2016 14:49:08 CEST Vasco Almeida wrote:\n> Mark error messages for translation passed to die() function.\n> Change \"Cannot\" to lowercase following the usual style.\n> \n> Reflect changes to test by using test_i18ngrep.\n> \n> Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n> ---\n>  builtin/blame.c               | 12 ++++++------\n>  t/t8003-blame-corner-cases.sh |  4 ++--\n>  2 files changed, 8 insertions(+), 8 deletions(-)\n> \n> diff --git a/builtin/blame.c b/builtin/blame.c\n> index a5bbf91..3fee197 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\n> *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 \nformats\");\n> +\t\t\tdie(_(\"--progress can't be used with --incremental or porcelain\n> formats\")); show_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\n> *prefix) sb.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\n> char *prefix) add_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\n> commit\"); +\t\t\tdie(_(\"--reverse and --first-parent together require\n> specified latest commit\")); }\n> \n>  \t/*\n> @@ -2779,7 +2779,7 @@ int cmd_blame(int argc, const char **argv, const char\n> *prefix) }\n> \n>  \t\tif (oidcmp(&c->object.oid, &sb.final->object.oid))\n> -\t\t\tdie(\"--reverse --first-parent together require range along first-\nparent\n> chain\"); +\t\t\tdie(_(\"--reverse --first-parent together require range along\n> first-parent chain\")); }\n> \n>  \tif (is_null_oid(&sb.final->object.oid)) {\n> @@ -2820,7 +2820,7 @@ int cmd_blame(int argc, const char **argv, const char\n> *prefix) &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(_(\"file %s has only %lu lines\"), path, lno);\n\nHere a plural version is needed.\n\n>  \t\tif (bottom < 1)\n>  \t\t\tbottom = 1;\n>  \t\tif (top < 1)\n> diff --git a/t/t8003-blame-corner-cases.sh b/t/t8003-blame-corner-cases.sh\n> index 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\n\n"},{"id":"301723","messageId":"xmqq37l55dol.fsf@gitster.mtv.corp.google.com","threadId":"44032","inReplyTo":"2532042.KMOOJ8STkh@cayenne","subject":"Re: [PATCH 04/13] i18n: blame: mark error messages for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-09-12T15:40:42Z","receivedAt":"2016-09-12T15:41:01Z","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>> @@ -2820,7 +2820,7 @@ int cmd_blame(int argc, const char **argv, const char\n>> *prefix) &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(_(\"file %s has only %lu lines\"), path, lno);\n>\n> Here a plural version is needed.\n\nGood eyes, like this?\n\n builtin/blame.c | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/builtin/blame.c b/builtin/blame.c\nindex 3fee197..cb12085 100644\n--- a/builtin/blame.c\n+++ b/builtin/blame.c\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\", lno),\n+\t\t\t    path, lno);\n \t\tif (bottom < 1)\n \t\t\tbottom = 1;\n \t\tif (top < 1)\n"},{"id":"301962","messageId":"1473951548-31733-1-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473259758-11836-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v3 01/14] i18n: apply: mark plural string for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-15T14:58:55Z","receivedAt":"2016-09-15T15:00:26Z","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":"301963","messageId":"1473951548-31733-2-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473951548-31733-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v3 02/14] i18n: apply: mark error messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-15T14:58:56Z","receivedAt":"2016-09-15T15:00:31Z","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":"301964","messageId":"1473951548-31733-3-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473951548-31733-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v3 03/14] i18n: apply: mark info messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-15T14:58:57Z","receivedAt":"2016-09-15T15:00:37Z","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":"301965","messageId":"1473951548-31733-4-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473951548-31733-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v3 04/14] i18n: blame: mark error messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-15T14:58:58Z","receivedAt":"2016-09-15T15:00:40Z","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":"301966","messageId":"1473951548-31733-5-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473951548-31733-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v3 05/14] i18n: branch: mark option description for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-15T14:58:59Z","receivedAt":"2016-09-15T15:00:43Z","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":"301967","messageId":"1473951548-31733-6-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473951548-31733-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v3 06/14] i18n: config: mark error message for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-15T14:59:00Z","receivedAt":"2016-09-15T15:00:47Z","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":"301968","messageId":"1473951548-31733-7-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473951548-31733-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v3 07/14] i18n: merge-recursive: mark error messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-15T14:59:01Z","receivedAt":"2016-09-15T15:00:50Z","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 | 17 ++++++++++-------\n 1 file changed, 10 insertions(+), 7 deletions(-)\n\ndiff --git a/builtin/merge-recursive.c b/builtin/merge-recursive.c\nindex fd2c455..3b09610 100644\n--- a/builtin/merge-recursive.c\n+++ b/builtin/merge-recursive.c\n@@ -42,30 +42,33 @@ 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(Q_(\"cannot handle more than %d base. \"\n+\t\t\t\t   \"Ignoring %s.\",\n+\t\t\t\t   \"cannot handle more than %d bases. \"\n+\t\t\t\t   \"Ignoring %s.\",\n+\t\t\t\t    (int)ARRAY_SIZE(bases)-1),\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":"301969","messageId":"1473951548-31733-8-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473951548-31733-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v3 08/14] i18n: merge-recursive: mark verbose message for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-15T14:59:02Z","receivedAt":"2016-09-15T15:00:54Z","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 3b09610..0dd9021 100644\n--- a/builtin/merge-recursive.c\n+++ b/builtin/merge-recursive.c\n@@ -74,7 +74,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":"301970","messageId":"1473951548-31733-9-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473951548-31733-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v3 09/14] i18n: notes: mark error messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-15T14:59:03Z","receivedAt":"2016-09-15T15:00:57Z","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 | 20 +++++++++++---------\n 1 file changed, 11 insertions(+), 9 deletions(-)\n\ndiff --git a/builtin/notes.c b/builtin/notes.c\nindex f848b89..229ad6d 100644\n--- a/builtin/notes.c\n+++ b/builtin/notes.c\n@@ -340,7 +340,9 @@ 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\t/* TRANSLATORS: the first %s will be replaced by a\n+\t\t   git notes command: 'add', 'merge', 'remove', etc.*/\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 +682,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 +706,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 +723,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":"301971","messageId":"1473951548-31733-11-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473951548-31733-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v3 11/14] i18n: receive-pack: mark messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-15T14:59:05Z","receivedAt":"2016-09-15T15:01:07Z","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":"301972","messageId":"1473951548-31733-10-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473951548-31733-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v3 10/14] notes: lowercase first word of error messages","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-15T14:59:04Z","receivedAt":"2016-09-15T15:01:13Z","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 229ad6d..5248a9b 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@@ -342,7 +342,7 @@ static struct notes_tree *init_notes_check(const char *subcommand,\n \tif (!starts_with(ref, \"refs/notes/\"))\n \t\t/* TRANSLATORS: the first %s will be replaced by a\n \t\t   git notes command: 'add', 'merge', 'remove', etc.*/\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@@ -369,13 +369,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@@ -424,7 +424,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@@ -510,12 +510,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@@ -534,7 +534,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@@ -593,7 +593,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@@ -656,13 +656,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@@ -682,11 +682,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@@ -706,11 +706,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@@ -723,10 +723,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@@ -796,7 +796,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@@ -820,7 +820,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@@ -857,10 +857,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@@ -1016,7 +1016,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":"301973","messageId":"1473951548-31733-12-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473951548-31733-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v3 12/14] i18n: show-branch: mark error messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-15T14:59:06Z","receivedAt":"2016-09-15T15:01:19Z","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 | 16 ++++++++--------\n 1 file changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/builtin/show-branch.c b/builtin/show-branch.c\nindex 2566935..5809371 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\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":"301974","messageId":"1473951548-31733-14-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473951548-31733-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v3 14/14] i18n: update-index: mark warnings for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-15T14:59:08Z","receivedAt":"2016-09-15T15:01:22Z","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":"301975","messageId":"1473951548-31733-13-git-send-email-vascomalmeida@sapo.pt","threadId":"44032","inReplyTo":"1473951548-31733-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v3 13/14] i18n: show-branch: mark plural strings for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-09-15T14:59:07Z","receivedAt":"2016-09-15T15:01:28Z","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 | 14 +++++++++-----\n 1 file changed, 9 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin/show-branch.c b/builtin/show-branch.c\nindex 5809371..623ca56 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,9 @@ 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\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":"302011","messageId":"xmqqy42sncok.fsf@gitster.mtv.corp.google.com","threadId":"44032","inReplyTo":"1473951548-31733-4-git-send-email-vascomalmeida@sapo.pt","subject":"Re: [PATCH v3 04/14] i18n: blame: mark error messages for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-09-15T20:14:03Z","receivedAt":"2016-09-15T20:14:11Z","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> @@ -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\nThis was missing in the earlier round, which is good to make it translated.\n\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\nLooks good here, too.  I would have moved \"lno),\" at the beginning\nof the third line to the end of the second line to make it easier to\nread, but this is OK.\n\n"},{"id":"302013","messageId":"xmqqtwdgncgb.fsf@gitster.mtv.corp.google.com","threadId":"44032","inReplyTo":"1473951548-31733-13-git-send-email-vascomalmeida@sapo.pt","subject":"Re: [PATCH v3 13/14] i18n: show-branch: mark plural strings for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-09-15T20:19:00Z","receivedAt":"2016-09-15T20:19:08Z","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> Mark plural string for translation using Q_().\n>\n> Although we already know that the plural sentence is always used in the\n> English source, other languages have complex plural rules they must\n> comply according to the value of MAX_REVS.\n\nNicely explained.  Thanks.\n"}]}