{"thread":{"id":"41978","subject":"[PATCH v2 1/7] i18n: index-pack: use plural string instead of normal one","startedAt":"2016-04-09T20:38:38Z","lastAt":"2016-04-29T06:57:50Z","messageCount":12,"participants":["Vasco Almeida","Junio C Hamano","Duy Nguyen","Jean-Noël Avila"],"isPatch":true,"patchVersion":2,"patchTotal":7},"messages":[{"id":"283049","messageId":"1460234324-13506-1-git-send-email-vascomalmeida@sapo.pt","threadId":"41978","inReplyTo":null,"subject":"[PATCH v2 1/7] i18n: index-pack: use plural string instead of normal one","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-04-09T20:38:38Z","receivedAt":"2016-04-09T20:38:38Z","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":"283051","messageId":"1460234324-13506-2-git-send-email-vascomalmeida@sapo.pt","threadId":"41978","inReplyTo":"1460234324-13506-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v2 2/7] i18n: unpack-trees: mark strings for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-04-09T20:38:39Z","receivedAt":"2016-04-09T20:38:39Z","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\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":"283053","messageId":"1460234324-13506-3-git-send-email-vascomalmeida@sapo.pt","threadId":"41978","inReplyTo":"1460234324-13506-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v2 3/7] i18n: git-parse-remote.sh: mark strings for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-04-09T20:38:40Z","receivedAt":"2016-04-09T20:38:40Z","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 | 50 +++++++++++++++++++++++++++++++++-----------------\n 2 files changed, 34 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..c5e5840 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,13 @@ 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+\tbranch=\"$(gettext \"branch\")\"\n \tif test $(git remote | wc -l) = 1\n \tthen\n \t\tremote=$(git remote)\n@@ -68,22 +73,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\techo \"    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":"283052","messageId":"1460234324-13506-4-git-send-email-vascomalmeida@sapo.pt","threadId":"41978","inReplyTo":"1460234324-13506-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v2 4/7] i18n: builtin/pull.c: mark strings for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-04-09T20:38:41Z","receivedAt":"2016-04-09T20:38:41Z","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..9e8883c 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 <%s> <%s>\", _(\"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 <%s> <%s>\", _(\"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":"283054","messageId":"1460234324-13506-5-git-send-email-vascomalmeida@sapo.pt","threadId":"41978","inReplyTo":"1460234324-13506-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v2 5/7] i18n: builtin/pull.c: split strings marked for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-04-09T20:38:42Z","receivedAt":"2016-04-09T20:38:42Z","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 | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/pull.c b/builtin/pull.c\nindex 9e8883c..617893c 100644\n--- a/builtin/pull.c\n+++ b/builtin/pull.c\n@@ -475,10 +475,10 @@ 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 <%s> <%s>\", _(\"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\t\t\tremote_name, curr_branch->name);\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/<%s> %s\\n\",\n+\t\t\t\tremote_name, _(\"branch\"), curr_branch->name);\n \t} else\n \t\tfprintf_ln(stderr, _(\"Your configuration specifies to merge with the ref '%s'\\n\"\n \t\t\t\"from the remote, but no such ref was fetched.\"),\n-- \n2.1.4\n"},{"id":"283055","messageId":"1460234324-13506-6-git-send-email-vascomalmeida@sapo.pt","threadId":"41978","inReplyTo":"1460234324-13506-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v2 6/7] i18n: builtin/rm.c: remove a comma ',' from string","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-04-09T20:38:43Z","receivedAt":"2016-04-09T20:38:43Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Remove a comma from string marked for translation. Make the string match the\none in builtin/mv.c. Now translators have do handle this string only once.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n builtin/rm.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/builtin/rm.c b/builtin/rm.c\nindex 8829b09..be83c43 100644\n--- a/builtin/rm.c\n+++ b/builtin/rm.c\n@@ -314,7 +314,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)\n \t\tlist.entry[list.nr].is_submodule = S_ISGITLINK(ce->ce_mode);\n \t\tif (list.entry[list.nr++].is_submodule &&\n \t\t    !is_staging_gitmodules_ok())\n-\t\t\tdie (_(\"Please, stage your changes to .gitmodules or stash them to proceed\"));\n+\t\t\tdie (_(\"Please stage your changes to .gitmodules or stash them to proceed\"));\n \t}\n \n \tif (pathspec.nr) {\n-- \n2.1.4\n"},{"id":"283056","messageId":"1460234324-13506-7-git-send-email-vascomalmeida@sapo.pt","threadId":"41978","inReplyTo":"1460234324-13506-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v2 7/7] i18n: builtin/branch.c: mark option for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-04-09T20:38:44Z","receivedAt":"2016-04-09T20:38:44Z","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":"283106","messageId":"xmqqinzptkaw.fsf@gitster.mtv.corp.google.com","threadId":"41978","inReplyTo":"1460234324-13506-4-git-send-email-vascomalmeida@sapo.pt","subject":"Re: [PATCH v2 4/7] i18n: builtin/pull.c: mark strings for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-04-10T18:01:27Z","receivedAt":"2016-04-10T18:01:27Z","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\nThis offers an interesting observation that I didn't think of while\nreviewing the first round of this series.\n\nDo translations want to translate \"remote\" and \"branch\" without the\n\"<bra\" and \"ket>\"?  Or is it better to allow translations to adjust\nthe \"quote around a placeholder\" in a locale dependent way?\n\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 <%s> <%s>\", _(\"remote\"), _(\"branch\"));\n\nI know this hunk follows I suggested, i.e. \"quotes around a\nplaceholder is universal and locale independent\".  However, ...\n\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... this does not.  It allows to translate the \"quote around a\nplaceholder\".  And where this phony \"remote_name\" string is used,\nthere is also this reference to <branch>:\n\n    fprintf_ln(stderr, _(\"If you wish to set tracking information for ...\"\n                    \"\\n\"\n                    \"    git branch --set-upstream-to=%s/<branch> %s\\n\"),\n                    remote_name, curr_branch->name);\n\nwhich also does.\n\nPerhaps the first hunk at around ll.458 would want to do\n\n> +\tfprintf_ln(stderr, \"    git pull %s %s\", _(\"<remote>\"), _(\"<branch>\"));\n\nto be consistent and more flexible for the translator's needs?  The\nquoting convention may be locale dependent after all.\n"},{"id":"283132","messageId":"570B7FCD.5050809@sapo.pt","threadId":"41978","inReplyTo":"xmqqinzptkaw.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v2 4/7] i18n: builtin/pull.c: mark strings for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-04-11T10:43:25Z","receivedAt":"2016-04-11T10:43:25Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Às 18:01 de 10-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> This offers an interesting observation that I didn't think of while\n> reviewing the first round of this series.\n> \n> Do translations want to translate \"remote\" and \"branch\" without the\n> \"<bra\" and \"ket>\"?  Or is it better to allow translations to adjust\n> the \"quote around a placeholder\" in a locale dependent way?\n> \nI think they want to translate without brackets.\nFrom what I can see, translator are using the same quoting.\nThe use of this kind of placeholders should be a new thing to languages,\nand might be limited to some backgrounds or situations. So, translator\nmight adopt the English way, since there are no better or equivalent way\nin their languages. Or I may be be assuming to much?\n\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 <%s> <%s>\", _(\"remote\"), _(\"branch\"));\n> \n> I know this hunk follows I suggested, i.e. \"quotes around a\n> placeholder is universal and locale independent\".  However, ...\n> \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> ... this does not.  It allows to translate the \"quote around a\n> placeholder\".  And where this phony \"remote_name\" string is used,\n> there is also this reference to <branch>:\n> \n>     fprintf_ln(stderr, _(\"If you wish to set tracking information for ...\"\n>                     \"\\n\"\n>                     \"    git branch --set-upstream-to=%s/<branch> %s\\n\"),\n>                     remote_name, curr_branch->name);\n> \n> which also does.\n> \n> Perhaps the first hunk at around ll.458 would want to do\n> \n>> +\tfprintf_ln(stderr, \"    git pull %s %s\", _(\"<remote>\"), _(\"<branch>\"));\n> \n> to be consistent and more flexible for the translator's needs?  The\n> quoting convention may be locale dependent after all.\n>\nIf we think placeholders quoting is important for localization, we could\nmark them for translation in usage_argh() function in parse-options.c:\n\ns = literal ? \" %s\" : _(\" <%s>\");\n\nand do the same for other cases of <%s> in that function. Plus, add a\ncomment for translator, perhaps.\n\nOtherwise, something like the following just to be consistent:\n\ndiff --git a/builtin/pull.c b/builtin/pull.c\nindex 617893c..317c3ce 100644\n--- a/builtin/pull.c\n+++ b/builtin/pull.c\n@@ -463,8 +463,7 @@ static void NORETURN die_no_merge_candidates(const char *repo, const char **refs\n        } else if (!curr_branch->merge_nr) {\n                const char *remote_name = NULL;\n \n-               if (for_each_remote(get_only_remote, &remote_name) || !remote_name)\n-                       remote_name = _(\"<remote>\");\n+               for_each_remote(get_only_remote, &remote_name);\n \n                fprintf_ln(stderr, _(\"There is no tracking information for the current branch.\"));\n                if (opt_rebase)\n@@ -477,8 +476,11 @@ static void NORETURN die_no_merge_candidates(const char *repo, const char **refs\n                fprintf(stderr, \"\\n\");\n                fprintf_ln(stderr, _(\"If you wish to set tracking information for this branch you can do so with:\"));\n                fprintf(stderr, \"\\n\");\n-               fprintf_ln(stderr, \"    git branch --set-upstream-to=%s/<%s> %s\\n\",\n-                               remote_name, _(\"branch\"), curr_branch->name);\n+               fprintf_ln(stderr, remote_name\n+                                  ? \"    git branch --set-upstream-to=%s/<%s> %s\\n\"\n+                                  : \"    git branch --set-upstream-to=<%s>/<%s> %s\\n\",\n+                               remote_name ? remote_name : _(\"remote\"),\n+                               _(\"branch\"), curr_branch->name);\n        } else\n                fprintf_ln(stderr, _(\"Your configuration specifies to merge with the ref '%s'\\n\"\n                        \"from the remote, but no such ref was fetched.\"),\n\nI think there is no need to internationalize the bracket. If we did so,\nthey would end up just in the way without adding much value for\ntranslators.\nWhat do you think?\n"},{"id":"283176","messageId":"CACsJy8BsxZTChST8Gb25LT1HwwR1AcAthjfOQmoAjxkF4qzvBw@mail.gmail.com","threadId":"41978","inReplyTo":"570B7FCD.5050809@sapo.pt","subject":"Re: [PATCH v2 4/7] i18n: builtin/pull.c: mark strings for translation","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2016-04-12T09:52:09Z","receivedAt":"2016-04-12T09:52:09Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Apr 11, 2016 at 5:43 PM, Vasco Almeida <vascomalmeida@sapo.pt> wrote:\n>>> @@ -458,13 +458,13 @@ static void NORETURN die_no_merge_candidates(const char *repo, const char **refs\n>>>                      fprintf_ln(stderr, _(\"Please specify which branch you want to merge with.\"));\n>>>              fprintf_ln(stderr, _(\"See git-pull(1) for details.\"));\n>>>              fprintf(stderr, \"\\n\");\n>>> -            fprintf_ln(stderr, \"    git pull <remote> <branch>\");\n>>> +            fprintf_ln(stderr, \"    git pull <%s> <%s>\", _(\"remote\"), _(\"branch\"));\n>>\n>> I know this hunk follows I suggested, i.e. \"quotes around a\n>> placeholder is universal and locale independent\".  However, ...\n>>\n>>>              fprintf(stderr, \"\\n\");\n>>>      } else if (!curr_branch->merge_nr) {\n>>>              const char *remote_name = NULL;\n>>>\n>>>              if (for_each_remote(get_only_remote, &remote_name) || !remote_name)\n>>> -                    remote_name = \"<remote>\";\n>>> +                    remote_name = _(\"<remote>\");\n>>>\n>> ... this does not.  It allows to translate the \"quote around a\n>> placeholder\".  And where this phony \"remote_name\" string is used,\n>> there is also this reference to <branch>:\n>>\n>>     fprintf_ln(stderr, _(\"If you wish to set tracking information for ...\"\n>>                     \"\\n\"\n>>                     \"    git branch --set-upstream-to=%s/<branch> %s\\n\"),\n>>                     remote_name, curr_branch->name);\n>>\n>> which also does.\n>>\n>> Perhaps the first hunk at around ll.458 would want to do\n>>\n>>> +    fprintf_ln(stderr, \"    git pull %s %s\", _(\"<remote>\"), _(\"<branch>\"));\n>>\n>> to be consistent and more flexible for the translator's needs?  The\n>> quoting convention may be locale dependent after all.\n>>\n> If we think placeholders quoting is important for localization,\n\nEx-translator speaking. Context is important. If it's me, I would even\ngo as far as marking the whole line translatable just to give more\ncontext (it's mostly just copy and translate a few words then). But\nthen again, I was half developer half translator and may see things a\nbit differently. Maybe _(\"<remote>\") is a good balance.\n-- \nDuy\n"},{"id":"283208","messageId":"xmqqk2k2ra6v.fsf@gitster.mtv.corp.google.com","threadId":"41978","inReplyTo":"1460234324-13506-3-git-send-email-vascomalmeida@sapo.pt","subject":"Re: [PATCH v2 3/7] i18n: git-parse-remote.sh: mark strings for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-04-12T17:47:20Z","receivedAt":"2016-04-12T17:47:20Z","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> diff --git a/git-parse-remote.sh b/git-parse-remote.sh\n> index 55fe8d5..c5e5840 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\nThis hunk should be dropped, I think.\n\nThe scriptlet is not meant to be used as a standalone command and is\ndesigned to be always used with \". git-parse-remote\".  The scripted\ncommand that uses it would already have done the above two.\n\n> @@ -68,22 +73,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\nThe original did not have to know $op_type can only be rebase or\nmerge, but this one hardcodes the assumption.  To make sure that\nanybody who adds yet another way to rebase need to come up with a\nphrasing that is suited for the new way, something like this would\nbe a good way to future-proof it.\n\n\tcase \"$op_type\" in\n        rebase)\n        \t... ;;\n        merge)\n        \t... ;;\n\t*)\n        \techo >&2 \"BUG: ...\"\n                exit 1 ;;\n\tesac\n"},{"id":"284895","messageId":"572305EE.8040704@gmail.com","threadId":"41978","inReplyTo":"CACsJy8BsxZTChST8Gb25LT1HwwR1AcAthjfOQmoAjxkF4qzvBw@mail.gmail.com","subject":"Re: [PATCH v2 4/7] i18n: builtin/pull.c: mark strings for translation","fromName":"Jean-Noël Avila","fromEmail":"avila.jn@gmail.com","sentAt":"2016-04-29T06:57:50Z","receivedAt":"2016-04-29T06:57:50Z","isPatch":true,"sender":{"key":"jn.avila@free.fr","avatar":"https://avatars.githubusercontent.com/u/156172?v=4"},"body":"Le 12/04/2016 11:52, Duy Nguyen a écrit :\n>\n> Ex-translator speaking. Context is important. If it's me, I would even\n> go as far as marking the whole line translatable just to give more\n> context (it's mostly just copy and translate a few words then). But\n> then again, I was half developer half translator and may see things a\n> bit differently. Maybe _(\"<remote>\") is a good balance.\n\nI second this opinion. Translating a single word without context is\ngenerally not advised. The english word might come up in different\nsituations with different grammatical forms for the translated version.\n\nAdding the brackets provides enough context, as long as the string is\nalways used in the same semantic field, describing the command line. I\njust don't know how much that helps reducing the amount of translated\nstrings.\n\n\nJN\n"}]}