{"thread":{"id":"41970","subject":"[PATCH 1/7] l10n: index-pack: use plural string instead of normal one","startedAt":"2016-04-08T20:02:39Z","lastAt":"2016-04-09T12:34:48Z","messageCount":14,"participants":["Vasco Almeida","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":7},"messages":[{"id":"282982","messageId":"1460145765-7454-1-git-send-email-vascomalmeida@sapo.pt","threadId":"41970","inReplyTo":null,"subject":"[PATCH 1/7] l10n: index-pack: use plural string instead of normal one","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-04-08T20:02:39Z","receivedAt":"2016-04-08T20:02:39Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Git could output \"completed with 1 local objects\", but in this case\nusing \"object\" instead of \"objects\" is the correct form.\nUse Q_() instead of _().\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/index-pack.c | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/builtin/index-pack.c b/builtin/index-pack.c\nindex 2d1eb8b..e8c71fc 100644\n--- a/builtin/index-pack.c\n+++ b/builtin/index-pack.c\n@@ -1250,7 +1250,9 @@ static void conclude_pack(int fix_thin_pack, const char *curr_pack, unsigned cha\n \t\t       nr_unresolved * sizeof(*objects));\n \t\tf = sha1fd(output_fd, curr_pack);\n \t\tfix_unresolved_deltas(f);\n-\t\tstrbuf_addf(&msg, _(\"completed with %d local objects\"),\n+\t\tstrbuf_addf(&msg, Q_(\"completed with %d local object\",\n+\t\t\t\t     \"completed with %d local objects\",\n+\t\t\t\t     nr_objects - nr_objects_initial),\n \t\t\t    nr_objects - nr_objects_initial);\n \t\tstop_progress_msg(&progress, msg.buf);\n \t\tstrbuf_release(&msg);\n-- \n2.1.4\n"},{"id":"282983","messageId":"1460145765-7454-2-git-send-email-vascomalmeida@sapo.pt","threadId":"41970","inReplyTo":"1460145765-7454-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 2/7] l10n: unpack-trees: mark strings for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-04-08T20:02:40Z","receivedAt":"2016-04-08T20:02:40Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark strings seen by the user inside setup_unpack_trees_porcelain() and\ndisplay_error_msgs() functions for translation.\n\nOne case Git outputs the named strings is when the user does some editing to\na file on some branch and then checks out other branch, but that file\nchanges by the checkout. This is the case of the first string marked.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n unpack-trees.c | 24 ++++++++++++------------\n 1 file changed, 12 insertions(+), 12 deletions(-)\n\ndiff --git a/unpack-trees.c b/unpack-trees.c\nindex 9f55cc2..4bc6b4f 100644\n--- a/unpack-trees.c\n+++ b/unpack-trees.c\n@@ -61,21 +61,21 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,\n \tconst char *cmd2 = strcmp(cmd, \"checkout\") ? cmd : \"switch branches\";\n \n \tif (advice_commit_before_merge)\n-\t\tmsg = \"Your local changes to the following files would be overwritten by %s:\\n%%s\"\n-\t\t\t\"Please, commit your changes or stash them before you can %s.\";\n+\t\tmsg = _(\"Your local changes to the following files would be overwritten by %s:\\n%%s\"\n+\t\t\t\"Please, commit your changes or stash them before you can %s.\");\n \telse\n-\t\tmsg = \"Your local changes to the following files would be overwritten by %s:\\n%%s\";\n+\t\tmsg = _(\"Your local changes to the following files would be overwritten by %s:\\n%%s\");\n \tmsgs[ERROR_WOULD_OVERWRITE] = msgs[ERROR_NOT_UPTODATE_FILE] =\n \t\txstrfmt(msg, cmd, cmd2);\n \n \tmsgs[ERROR_NOT_UPTODATE_DIR] =\n-\t\t\"Updating the following directories would lose untracked files in it:\\n%s\";\n+\t\t_(\"Updating the following directories would lose untracked files in it:\\n%s\");\n \n \tif (advice_commit_before_merge)\n-\t\tmsg = \"The following untracked working tree files would be %s by %s:\\n%%s\"\n-\t\t\t\"Please move or remove them before you can %s.\";\n+\t\tmsg = _(\"The following untracked working tree files would be %s by %s:\\n%%s\"\n+\t\t\t\"Please move or remove them before you can %s.\");\n \telse\n-\t\tmsg = \"The following untracked working tree files would be %s by %s:\\n%%s\";\n+\t\tmsg = _(\"The following untracked working tree files would be %s by %s:\\n%%s\");\n \n \tmsgs[ERROR_WOULD_LOSE_UNTRACKED_REMOVED] = xstrfmt(msg, \"removed\", cmd, cmd2);\n \tmsgs[ERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN] = xstrfmt(msg, \"overwritten\", cmd, cmd2);\n@@ -84,14 +84,14 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,\n \t * Special case: ERROR_BIND_OVERLAP refers to a pair of paths, we\n \t * cannot easily display it as a list.\n \t */\n-\tmsgs[ERROR_BIND_OVERLAP] = \"Entry '%s' overlaps with '%s'.  Cannot bind.\";\n+\tmsgs[ERROR_BIND_OVERLAP] = _(\"Entry '%s' overlaps with '%s'.  Cannot bind.\");\n \n \tmsgs[ERROR_SPARSE_NOT_UPTODATE_FILE] =\n-\t\t\"Cannot update sparse checkout: the following entries are not up-to-date:\\n%s\";\n+\t\t_(\"Cannot update sparse checkout: the following entries are not up-to-date:\\n%s\");\n \tmsgs[ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN] =\n-\t\t\"The following Working tree files would be overwritten by sparse checkout update:\\n%s\";\n+\t\t_(\"The following Working tree files would be overwritten by sparse checkout update:\\n%s\");\n \tmsgs[ERROR_WOULD_LOSE_ORPHANED_REMOVED] =\n-\t\t\"The following Working tree files would be removed by sparse checkout update:\\n%s\";\n+\t\t_(\"The following Working tree files would be removed by sparse checkout update:\\n%s\");\n \n \topts->show_all_errors = 1;\n \t/* rejected paths may not have a static buffer */\n@@ -168,7 +168,7 @@ static void display_error_msgs(struct unpack_trees_options *o)\n \t\tstring_list_clear(rejects, 0);\n \t}\n \tif (something_displayed)\n-\t\tfprintf(stderr, \"Aborting\\n\");\n+\t\tfprintf(stderr, _(\"Aborting\\n\"));\n }\n \n /*\n-- \n2.1.4\n"},{"id":"282984","messageId":"1460145765-7454-3-git-send-email-vascomalmeida@sapo.pt","threadId":"41970","inReplyTo":"1460145765-7454-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 3/7] l10n: git-parse-remote.sh: mark strings for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-04-08T20:02:41Z","receivedAt":"2016-04-08T20:02:41Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Change Makefile to include git-parse-remote.sh in LOCALIZED_SH.\n\nTODO: remove 3rd argument of error_on_missing_default_upstream function\nthat is no longer required.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n Makefile            |  2 +-\n git-parse-remote.sh | 49 ++++++++++++++++++++++++++++++++-----------------\n 2 files changed, 33 insertions(+), 18 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 2742a69..2249bab 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2069,7 +2069,7 @@ XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell \\\n \t--keyword=gettextln --keyword=eval_gettextln\n XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --keyword=__ --language=Perl\n LOCALIZED_C = $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H)\n-LOCALIZED_SH = $(SCRIPT_SH)\n+LOCALIZED_SH = $(SCRIPT_SH) git-parse-remote.sh\n LOCALIZED_PERL = $(SCRIPT_PERL)\n \n ifdef XGETTEXT_INCLUDE_TESTS\ndiff --git a/git-parse-remote.sh b/git-parse-remote.sh\nindex 55fe8d5..ee3ad1f 100644\n--- a/git-parse-remote.sh\n+++ b/git-parse-remote.sh\n@@ -6,6 +6,9 @@\n # this would fail in that case and would issue an error message.\n GIT_DIR=$(git rev-parse -q --git-dir) || :;\n \n+. git-sh-setup\n+. git-sh-i18n\n+\n get_default_remote () {\n \tcurr_branch=$(git symbolic-ref -q HEAD)\n \tcurr_branch=\"${curr_branch#refs/heads/}\"\n@@ -56,11 +59,12 @@ get_remote_merge_branch () {\n error_on_missing_default_upstream () {\n \tcmd=\"$1\"\n \top_type=\"$2\"\n-\top_prep=\"$3\"\n+\top_prep=\"$3\" # FIXME: op_prep is no longer used\n \texample=\"$4\"\n \tbranch_name=$(git symbolic-ref -q HEAD)\n+\tdisplay_branch_name=\"${branch_name#refs/heads/}\"\n \t# If there's only one remote, use that in the suggestion\n-\tremote=\"<remote>\"\n+\tremote=$(gettext \"<remote>\")\n \tif test $(git remote | wc -l) = 1\n \tthen\n \t\tremote=$(git remote)\n@@ -68,22 +72,33 @@ error_on_missing_default_upstream () {\n \n \tif test -z \"$branch_name\"\n \tthen\n-\t\techo \"You are not currently on a branch. Please specify which\n-branch you want to $op_type $op_prep. See git-${cmd}(1) for details.\n-\n-    $example\n-\"\n+\t\tgettextln \"You are not currently on a branch.\"\n+\t\tif test $op_type = \"rebase\"\n+\t\tthen\n+\t\t\tgettextln \"Please specify which branch you want to rebase against.\"\n+\t\telse\n+\t\t\tgettextln \"Please specify which branch you want to merge with.\"\n+\t\tfi\n+\t\teval_gettextln \"See git-\\${cmd}(1) for details.\"\n+\t\techo\n+\t\techo \"    $example\"\n+\t\techo\n \telse\n-\t\techo \"There is no tracking information for the current branch.\n-Please specify which branch you want to $op_type $op_prep.\n-See git-${cmd}(1) for details\n-\n-    $example\n-\n-If you wish to set tracking information for this branch you can do so with:\n-\n-    git branch --set-upstream-to=$remote/<branch> ${branch_name#refs/heads/}\n-\"\n+\t\tgettextln \"There is no tracking information for the current branch.\"\n+\t\tif test $op_type = \"rebase\"\n+\t\tthen\n+\t\t\tgettextln \"Please specify which branch you want to rebase against.\"\n+\t\telse\n+\t\t\tgettextln \"Please specify which branch you want to merge with.\"\n+\t\tfi\n+\t\teval_gettextln \"See git-\\${cmd}(1) for details.\"\n+\t\techo\n+\t\techo \"    $example\"\n+\t\techo\n+\t\tgettextln \"If you wish to set tracking information for this branch you can do so with:\"\n+\t\techo\n+\t\teval_gettextln \"    git branch --set-upstream-to=\\$remote/<branch> \\$display_branch_name\"\n+\t\techo\n \tfi\n \texit 1\n }\n-- \n2.1.4\n"},{"id":"282985","messageId":"1460145765-7454-4-git-send-email-vascomalmeida@sapo.pt","threadId":"41970","inReplyTo":"1460145765-7454-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 4/7] l10n: builtin/pull.c: mark strings for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-04-08T20:02:42Z","receivedAt":"2016-04-08T20:02:42Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Some translations might also translate \"<remote>\" and \"<branch>\".\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/pull.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/pull.c b/builtin/pull.c\nindex 10eff03..a99d6b9 100644\n--- a/builtin/pull.c\n+++ b/builtin/pull.c\n@@ -458,13 +458,13 @@ static void NORETURN die_no_merge_candidates(const char *repo, const char **refs\n \t\t\tfprintf_ln(stderr, _(\"Please specify which branch you want to merge with.\"));\n \t\tfprintf_ln(stderr, _(\"See git-pull(1) for details.\"));\n \t\tfprintf(stderr, \"\\n\");\n-\t\tfprintf_ln(stderr, \"    git pull <remote> <branch>\");\n+\t\tfprintf_ln(stderr, _(\"    git pull <remote> <branch>\"));\n \t\tfprintf(stderr, \"\\n\");\n \t} else if (!curr_branch->merge_nr) {\n \t\tconst char *remote_name = NULL;\n \n \t\tif (for_each_remote(get_only_remote, &remote_name) || !remote_name)\n-\t\t\tremote_name = \"<remote>\";\n+\t\t\tremote_name = _(\"<remote>\");\n \n \t\tfprintf_ln(stderr, _(\"There is no tracking information for the current branch.\"));\n \t\tif (opt_rebase)\n@@ -473,7 +473,7 @@ static void NORETURN die_no_merge_candidates(const char *repo, const char **refs\n \t\t\tfprintf_ln(stderr, _(\"Please specify which branch you want to merge with.\"));\n \t\tfprintf_ln(stderr, _(\"See git-pull(1) for details.\"));\n \t\tfprintf(stderr, \"\\n\");\n-\t\tfprintf_ln(stderr, \"    git pull <remote> <branch>\");\n+\t\tfprintf_ln(stderr, _(\"    git pull <remote> <branch>\"));\n \t\tfprintf(stderr, \"\\n\");\n \t\tfprintf_ln(stderr, _(\"If you wish to set tracking information for this branch you can do so with:\\n\"\n \t\t\t\t\"\\n\"\n-- \n2.1.4\n"},{"id":"282988","messageId":"1460145765-7454-5-git-send-email-vascomalmeida@sapo.pt","threadId":"41970","inReplyTo":"1460145765-7454-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 5/7] l10n: builtin/pull.c: split strings marked for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-04-08T20:02:43Z","receivedAt":"2016-04-08T20:02:43Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Split string \"If you wish to set tracking information\nfor this branch you can do so with:\\n\" to match occurring string in\ngit-parse-remote.sh. In this case, the translator handles it only once.\n\nOn the other hand, the translations of the string that were already made\nare mark as fuzzy and the translator needs to correct it herself.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/pull.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/pull.c b/builtin/pull.c\nindex a99d6b9..ac942f6 100644\n--- a/builtin/pull.c\n+++ b/builtin/pull.c\n@@ -475,9 +475,9 @@ static void NORETURN die_no_merge_candidates(const char *repo, const char **refs\n \t\tfprintf(stderr, \"\\n\");\n \t\tfprintf_ln(stderr, _(\"    git pull <remote> <branch>\"));\n \t\tfprintf(stderr, \"\\n\");\n-\t\tfprintf_ln(stderr, _(\"If you wish to set tracking information for this branch you can do so with:\\n\"\n-\t\t\t\t\"\\n\"\n-\t\t\t\t\"    git branch --set-upstream-to=%s/<branch> %s\\n\"),\n+\t\tfprintf_ln(stderr, _(\"If you wish to set tracking information for this branch you can do so with:\"));\n+\t\tfprintf(stderr, \"\\n\");\n+\t\tfprintf_ln(stderr, _(\"    git branch --set-upstream-to=%s/<branch> %s\\n\"),\n \t\t\t\tremote_name, curr_branch->name);\n \t} else\n \t\tfprintf_ln(stderr, _(\"Your configuration specifies to merge with the ref '%s'\\n\"\n-- \n2.1.4\n"},{"id":"282987","messageId":"1460145765-7454-6-git-send-email-vascomalmeida@sapo.pt","threadId":"41970","inReplyTo":"1460145765-7454-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 6/7] l10n: mv.c: add a comma ',' to string","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-04-08T20:02:44Z","receivedAt":"2016-04-08T20:02:44Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Add a comma to string marked for translation. Make the string match the\none in rm.c. Now translators have do handle this string only once.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/mv.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/builtin/mv.c b/builtin/mv.c\nindex aeae855..1bf8df1 100644\n--- a/builtin/mv.c\n+++ b/builtin/mv.c\n@@ -69,7 +69,7 @@ static void prepare_move_submodule(const char *src, int first,\n \tif (!S_ISGITLINK(active_cache[first]->ce_mode))\n \t\tdie(_(\"Directory %s is in index and no submodule?\"), src);\n \tif (!is_staging_gitmodules_ok())\n-\t\tdie(_(\"Please stage your changes to .gitmodules or stash them to proceed\"));\n+\t\tdie(_(\"Please, stage your changes to .gitmodules or stash them to proceed\"));\n \tstrbuf_addf(&submodule_dotgit, \"%s/.git\", src);\n \t*submodule_gitfile = read_gitfile(submodule_dotgit.buf);\n \tif (*submodule_gitfile)\n-- \n2.1.4\n"},{"id":"282986","messageId":"1460145765-7454-7-git-send-email-vascomalmeida@sapo.pt","threadId":"41970","inReplyTo":"1460145765-7454-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 7/7] l10n: builtin/branch.c: mark option for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-04-08T20:02:45Z","receivedAt":"2016-04-08T20:02:45Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark description and parameter for option \"set-upstream-to\" for translation.\n\nSigned-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 7b45b6b..5ab106b 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -620,7 +620,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \t\t\tBRANCH_TRACK_EXPLICIT),\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, \"upstream\", \"change the upstream info\"),\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__COLOR(&branch_use_color, N_(\"use colored output\")),\n \t\tOPT_SET_INT('r', \"remotes\",     &filter.kind, N_(\"act on remote-tracking branches\"),\n-- \n2.1.4\n"},{"id":"282990","messageId":"xmqqpotzvoia.fsf@gitster.mtv.corp.google.com","threadId":"41970","inReplyTo":"1460145765-7454-2-git-send-email-vascomalmeida@sapo.pt","subject":"Re: [PATCH 2/7] l10n: unpack-trees: mark strings for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-04-08T20:23:09Z","receivedAt":"2016-04-08T20:23:09Z","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 strings seen by the user inside setup_unpack_trees_porcelain() and\n> display_error_msgs() functions for translation.\n>\n> One case Git outputs the named strings is when the user does some editing to\n> a file on some branch and then checks out other branch, but that file\n> changes by the checkout. This is the case of the first string marked.\n\nThe second paragraph puzzling.  Other strings are not shown at all?\nOr is it just you didn't bother explaining the others cases?\n\nEither case, it is not immediately clear why you felt that one\nstring among others deserve more attention.  Care to elaborate?\n\nIn the patch itself I did not find anything questionable, though.\n\nThanks.\n\n>\n> Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n> ---\n>  unpack-trees.c | 24 ++++++++++++------------\n>  1 file changed, 12 insertions(+), 12 deletions(-)\n>\n> diff --git a/unpack-trees.c b/unpack-trees.c\n> index 9f55cc2..4bc6b4f 100644\n> --- a/unpack-trees.c\n> +++ b/unpack-trees.c\n> @@ -61,21 +61,21 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,\n>  \tconst char *cmd2 = strcmp(cmd, \"checkout\") ? cmd : \"switch branches\";\n>  \n>  \tif (advice_commit_before_merge)\n> -\t\tmsg = \"Your local changes to the following files would be overwritten by %s:\\n%%s\"\n> -\t\t\t\"Please, commit your changes or stash them before you can %s.\";\n> +\t\tmsg = _(\"Your local changes to the following files would be overwritten by %s:\\n%%s\"\n> +\t\t\t\"Please, commit your changes or stash them before you can %s.\");\n>  \telse\n> -\t\tmsg = \"Your local changes to the following files would be overwritten by %s:\\n%%s\";\n> +\t\tmsg = _(\"Your local changes to the following files would be overwritten by %s:\\n%%s\");\n>  \tmsgs[ERROR_WOULD_OVERWRITE] = msgs[ERROR_NOT_UPTODATE_FILE] =\n>  \t\txstrfmt(msg, cmd, cmd2);\n>  \n>  \tmsgs[ERROR_NOT_UPTODATE_DIR] =\n> -\t\t\"Updating the following directories would lose untracked files in it:\\n%s\";\n> +\t\t_(\"Updating the following directories would lose untracked files in it:\\n%s\");\n>  \n>  \tif (advice_commit_before_merge)\n> -\t\tmsg = \"The following untracked working tree files would be %s by %s:\\n%%s\"\n> -\t\t\t\"Please move or remove them before you can %s.\";\n> +\t\tmsg = _(\"The following untracked working tree files would be %s by %s:\\n%%s\"\n> +\t\t\t\"Please move or remove them before you can %s.\");\n>  \telse\n> -\t\tmsg = \"The following untracked working tree files would be %s by %s:\\n%%s\";\n> +\t\tmsg = _(\"The following untracked working tree files would be %s by %s:\\n%%s\");\n>  \n>  \tmsgs[ERROR_WOULD_LOSE_UNTRACKED_REMOVED] = xstrfmt(msg, \"removed\", cmd, cmd2);\n>  \tmsgs[ERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN] = xstrfmt(msg, \"overwritten\", cmd, cmd2);\n> @@ -84,14 +84,14 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,\n>  \t * Special case: ERROR_BIND_OVERLAP refers to a pair of paths, we\n>  \t * cannot easily display it as a list.\n>  \t */\n> -\tmsgs[ERROR_BIND_OVERLAP] = \"Entry '%s' overlaps with '%s'.  Cannot bind.\";\n> +\tmsgs[ERROR_BIND_OVERLAP] = _(\"Entry '%s' overlaps with '%s'.  Cannot bind.\");\n>  \n>  \tmsgs[ERROR_SPARSE_NOT_UPTODATE_FILE] =\n> -\t\t\"Cannot update sparse checkout: the following entries are not up-to-date:\\n%s\";\n> +\t\t_(\"Cannot update sparse checkout: the following entries are not up-to-date:\\n%s\");\n>  \tmsgs[ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN] =\n> -\t\t\"The following Working tree files would be overwritten by sparse checkout update:\\n%s\";\n> +\t\t_(\"The following Working tree files would be overwritten by sparse checkout update:\\n%s\");\n>  \tmsgs[ERROR_WOULD_LOSE_ORPHANED_REMOVED] =\n> -\t\t\"The following Working tree files would be removed by sparse checkout update:\\n%s\";\n> +\t\t_(\"The following Working tree files would be removed by sparse checkout update:\\n%s\");\n>  \n>  \topts->show_all_errors = 1;\n>  \t/* rejected paths may not have a static buffer */\n> @@ -168,7 +168,7 @@ static void display_error_msgs(struct unpack_trees_options *o)\n>  \t\tstring_list_clear(rejects, 0);\n>  \t}\n>  \tif (something_displayed)\n> -\t\tfprintf(stderr, \"Aborting\\n\");\n> +\t\tfprintf(stderr, _(\"Aborting\\n\"));\n>  }\n>  \n>  /*\n"},{"id":"282991","messageId":"xmqqlh4nvoc1.fsf@gitster.mtv.corp.google.com","threadId":"41970","inReplyTo":"1460145765-7454-1-git-send-email-vascomalmeida@sapo.pt","subject":"Re: [PATCH 1/7] l10n: index-pack: use plural string instead of normal one","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-04-08T20:26:54Z","receivedAt":"2016-04-08T20:26:54Z","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> Subject: Re: [PATCH 1/7] l10n: index-pack: use plural string instead of normal one\n\nThese are probably better prefixed with \"i18n:\" (i.e. enable\ntranslation into many languages) not \"l10n:\" (i.e. actually\ntranslate for languages).\n\n> Git could output \"completed with 1 local objects\", but in this case\n> using \"object\" instead of \"objects\" is the correct form.\n> Use Q_() instead of _().\n>\n> Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n> ---\n>  builtin/index-pack.c | 4 +++-\n>  1 file changed, 3 insertions(+), 1 deletion(-)\n>\n> diff --git a/builtin/index-pack.c b/builtin/index-pack.c\n> index 2d1eb8b..e8c71fc 100644\n> --- a/builtin/index-pack.c\n> +++ b/builtin/index-pack.c\n> @@ -1250,7 +1250,9 @@ static void conclude_pack(int fix_thin_pack, const char *curr_pack, unsigned cha\n>  \t\t       nr_unresolved * sizeof(*objects));\n>  \t\tf = sha1fd(output_fd, curr_pack);\n>  \t\tfix_unresolved_deltas(f);\n> -\t\tstrbuf_addf(&msg, _(\"completed with %d local objects\"),\n> +\t\tstrbuf_addf(&msg, Q_(\"completed with %d local object\",\n> +\t\t\t\t     \"completed with %d local objects\",\n> +\t\t\t\t     nr_objects - nr_objects_initial),\n>  \t\t\t    nr_objects - nr_objects_initial);\n\nLooks sensible.  It seems that all existing instances of Q_() that\nhave \"%d\" for the plural one also use \"%d\" for the singular, so this\nupdate is consistent with them.\n\nI however wonder if we want to say \"completed with 1 local object\"\nin the message, which would allow translation of it into \"completed\nwith one local object\" etc., but that is a separate topic.\n\nThanks.\n\n>  \t\tstop_progress_msg(&progress, msg.buf);\n>  \t\tstrbuf_release(&msg);\n"},{"id":"282992","messageId":"xmqqh9fbvo6d.fsf@gitster.mtv.corp.google.com","threadId":"41970","inReplyTo":"1460145765-7454-3-git-send-email-vascomalmeida@sapo.pt","subject":"Re: [PATCH 3/7] l10n: git-parse-remote.sh: mark strings for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-04-08T20:30:18Z","receivedAt":"2016-04-08T20:30:18Z","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> +\t\tgettextln \"You are not currently on a branch.\"\n> +\t\tif test $op_type = \"rebase\"\n\n\tif test \"$op_type\" = rebase\n\nthat is, $op_type could be an empty string that 'test' may not even\nsee hence it should be double-quoted to ensure 'test' sees an empty\nstring in that case, while \"rebase\" cannot be an empty string by\ndefinition so there is no need to quote it.\n\nThanks.\n"},{"id":"282993","messageId":"xmqqd1pzvo0p.fsf@gitster.mtv.corp.google.com","threadId":"41970","inReplyTo":"1460145765-7454-4-git-send-email-vascomalmeida@sapo.pt","subject":"Re: [PATCH 4/7] l10n: builtin/pull.c: mark strings for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-04-08T20:33:42Z","receivedAt":"2016-04-08T20:33:42Z","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> Some translations might also translate \"<remote>\" and \"<branch>\".\n> ...\n>  \t\tfprintf_ln(stderr, _(\"See git-pull(1) for details.\"));\n>  \t\tfprintf(stderr, \"\\n\");\n> -\t\tfprintf_ln(stderr, \"    git pull <remote> <branch>\");\n> +\t\tfprintf_ln(stderr, _(\"    git pull <remote> <branch>\"));\n\nBut \"git pull\" itself must never be translated, and there is no hint\ngiven to those who are working on *.po files to prevent it.\n\nWouldn't it make more sense to do it like this?\n\n\tfprintf_ln(stderr, \"    git pull <%s> <%s>\", _(\"remote\"), _(\"branch\"));\n"},{"id":"282994","messageId":"xmqq8u0nvnxq.fsf@gitster.mtv.corp.google.com","threadId":"41970","inReplyTo":"1460145765-7454-6-git-send-email-vascomalmeida@sapo.pt","subject":"Re: [PATCH 6/7] l10n: mv.c: add a comma ',' to string","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-04-08T20:35:29Z","receivedAt":"2016-04-08T20:35:29Z","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> Add a comma to string marked for translation. Make the string match the\n> one in rm.c. Now translators have do handle this string only once.\n\nI suspect these \"comma after Please\" is a French invention.\n\nAiming to reduce these minor variants is a good goal, but wouldn't\nwe want to go in the opposite direction?\n\n>\n> Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n> ---\n>  builtin/mv.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/builtin/mv.c b/builtin/mv.c\n> index aeae855..1bf8df1 100644\n> --- a/builtin/mv.c\n> +++ b/builtin/mv.c\n> @@ -69,7 +69,7 @@ static void prepare_move_submodule(const char *src, int first,\n>  \tif (!S_ISGITLINK(active_cache[first]->ce_mode))\n>  \t\tdie(_(\"Directory %s is in index and no submodule?\"), src);\n>  \tif (!is_staging_gitmodules_ok())\n> -\t\tdie(_(\"Please stage your changes to .gitmodules or stash them to proceed\"));\n> +\t\tdie(_(\"Please, stage your changes to .gitmodules or stash them to proceed\"));\n>  \tstrbuf_addf(&submodule_dotgit, \"%s/.git\", src);\n>  \t*submodule_gitfile = read_gitfile(submodule_dotgit.buf);\n>  \tif (*submodule_gitfile)\n"},{"id":"283013","messageId":"5708F34C.3090004@sapo.pt","threadId":"41970","inReplyTo":"xmqqpotzvoia.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 2/7] l10n: unpack-trees: mark strings for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-04-09T12:19:24Z","receivedAt":"2016-04-09T12:19:24Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Às 20:23 de 08-04-2016, Junio C Hamano escreveu:\n> Vasco Almeida <vascomalmeida@sapo.pt> writes:\n> \n>> Mark strings seen by the user inside setup_unpack_trees_porcelain() and\n>> display_error_msgs() functions for translation.\n>>\n>> One case Git outputs the named strings is when the user does some editing to\n>> a file on some branch and then checks out other branch, but that file\n>> changes by the checkout. This is the case of the first string marked.\n> \n> The second paragraph puzzling.  Other strings are not shown at all?\n> Or is it just you didn't bother explaining the others cases?\n> \n> Either case, it is not immediately clear why you felt that one\n> string among others deserve more attention.  Care to elaborate?\n\nI meant that as an example, which was the situation I was when I found\nthe untranslated string.\nI should have written that outside the commit message, as a note.\nI'm going to remove that paragraph since it isn’t irrelevant and\nconfusing. Hope I answered you.\n\n> \n> In the patch itself I did not find anything questionable, though.\n> \n> Thanks.\n> \n>>\n>> Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n>> ---\n>>  unpack-trees.c | 24 ++++++++++++------------\n>>  1 file changed, 12 insertions(+), 12 deletions(-)\n>>\n>> diff --git a/unpack-trees.c b/unpack-trees.c\n>> index 9f55cc2..4bc6b4f 100644\n>> --- a/unpack-trees.c\n>> +++ b/unpack-trees.c\n>> @@ -61,21 +61,21 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,\n>>  \tconst char *cmd2 = strcmp(cmd, \"checkout\") ? cmd : \"switch branches\";\n>>  \n>>  \tif (advice_commit_before_merge)\n>> -\t\tmsg = \"Your local changes to the following files would be overwritten by %s:\\n%%s\"\n>> -\t\t\t\"Please, commit your changes or stash them before you can %s.\";\n>> +\t\tmsg = _(\"Your local changes to the following files would be overwritten by %s:\\n%%s\"\n>> +\t\t\t\"Please, commit your changes or stash them before you can %s.\");\n>>  \telse\n>> -\t\tmsg = \"Your local changes to the following files would be overwritten by %s:\\n%%s\";\n>> +\t\tmsg = _(\"Your local changes to the following files would be overwritten by %s:\\n%%s\");\n>>  \tmsgs[ERROR_WOULD_OVERWRITE] = msgs[ERROR_NOT_UPTODATE_FILE] =\n>>  \t\txstrfmt(msg, cmd, cmd2);\n>>  \n>>  \tmsgs[ERROR_NOT_UPTODATE_DIR] =\n>> -\t\t\"Updating the following directories would lose untracked files in it:\\n%s\";\n>> +\t\t_(\"Updating the following directories would lose untracked files in it:\\n%s\");\n>>  \n>>  \tif (advice_commit_before_merge)\n>> -\t\tmsg = \"The following untracked working tree files would be %s by %s:\\n%%s\"\n>> -\t\t\t\"Please move or remove them before you can %s.\";\n>> +\t\tmsg = _(\"The following untracked working tree files would be %s by %s:\\n%%s\"\n>> +\t\t\t\"Please move or remove them before you can %s.\");\n>>  \telse\n>> -\t\tmsg = \"The following untracked working tree files would be %s by %s:\\n%%s\";\n>> +\t\tmsg = _(\"The following untracked working tree files would be %s by %s:\\n%%s\");\n>>  \n>>  \tmsgs[ERROR_WOULD_LOSE_UNTRACKED_REMOVED] = xstrfmt(msg, \"removed\", cmd, cmd2);\n>>  \tmsgs[ERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN] = xstrfmt(msg, \"overwritten\", cmd, cmd2);\n>> @@ -84,14 +84,14 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,\n>>  \t * Special case: ERROR_BIND_OVERLAP refers to a pair of paths, we\n>>  \t * cannot easily display it as a list.\n>>  \t */\n>> -\tmsgs[ERROR_BIND_OVERLAP] = \"Entry '%s' overlaps with '%s'.  Cannot bind.\";\n>> +\tmsgs[ERROR_BIND_OVERLAP] = _(\"Entry '%s' overlaps with '%s'.  Cannot bind.\");\n>>  \n>>  \tmsgs[ERROR_SPARSE_NOT_UPTODATE_FILE] =\n>> -\t\t\"Cannot update sparse checkout: the following entries are not up-to-date:\\n%s\";\n>> +\t\t_(\"Cannot update sparse checkout: the following entries are not up-to-date:\\n%s\");\n>>  \tmsgs[ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN] =\n>> -\t\t\"The following Working tree files would be overwritten by sparse checkout update:\\n%s\";\n>> +\t\t_(\"The following Working tree files would be overwritten by sparse checkout update:\\n%s\");\n>>  \tmsgs[ERROR_WOULD_LOSE_ORPHANED_REMOVED] =\n>> -\t\t\"The following Working tree files would be removed by sparse checkout update:\\n%s\";\n>> +\t\t_(\"The following Working tree files would be removed by sparse checkout update:\\n%s\");\n>>  \n>>  \topts->show_all_errors = 1;\n>>  \t/* rejected paths may not have a static buffer */\n>> @@ -168,7 +168,7 @@ static void display_error_msgs(struct unpack_trees_options *o)\n>>  \t\tstring_list_clear(rejects, 0);\n>>  \t}\n>>  \tif (something_displayed)\n>> -\t\tfprintf(stderr, \"Aborting\\n\");\n>> +\t\tfprintf(stderr, _(\"Aborting\\n\"));\n>>  }\n>>  \n>>  /*\n"},{"id":"283020","messageId":"5708F6E8.506@sapo.pt","threadId":"41970","inReplyTo":"xmqqd1pzvo0p.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 4/7] l10n: builtin/pull.c: mark strings for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-04-09T12:34:48Z","receivedAt":"2016-04-09T12:34:48Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Às 20:33 de 08-04-2016, Junio C Hamano escreveu:\n> Vasco Almeida <vascomalmeida@sapo.pt> writes:\n> \n>> Some translations might also translate \"<remote>\" and \"<branch>\".\n>> ...\n>>  \t\tfprintf_ln(stderr, _(\"See git-pull(1) for details.\"));\n>>  \t\tfprintf(stderr, \"\\n\");\n>> -\t\tfprintf_ln(stderr, \"    git pull <remote> <branch>\");\n>> +\t\tfprintf_ln(stderr, _(\"    git pull <remote> <branch>\"));\n> \n> But \"git pull\" itself must never be translated, and there is no hint\n> given to those who are working on *.po files to prevent it.\n> \n> Wouldn't it make more sense to do it like this?\n> \n> \tfprintf_ln(stderr, \"    git pull <%s> <%s>\", _(\"remote\"), _(\"branch\"));\n> \nYes, I think the way you suggest is better, since it prevents\ntranslation mistakes. I'll do the same to\n\neval_gettextln \"    git branch --set-upstream-to=\\$remote/<branch>\\$display_branch_name\"\n\nin git-parse-remote.sh ending.\n"}]}