{"thread":{"id":"29502","subject":"[PATCH] i18n: format_tracking_info \"Your branch is behind\" message","startedAt":"2012-02-01T17:21:54Z","lastAt":"2012-02-01T17:39:43Z","messageCount":2,"participants":["Jiang Xin","Ævar Arnfjörð Bjarmason"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"183484","messageId":"1328116914-61381-1-git-send-email-worldhello.net@gmail.com","threadId":"29502","inReplyTo":null,"subject":"[PATCH] i18n: format_tracking_info \"Your branch is behind\" message","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2012-02-01T17:21:54Z","receivedAt":"2012-02-01T17:21:54Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"Function format_tracking_info in remote.c is called by\nwt_status_print_tracking in wt-status.c, which will print\nbranch tracking message in git-status. git-checkout also\nshow these messages through it's report_tracking function.\n\nSigned-off-by: Jiang Xin <worldhello.net@gmail.com>\n---\n remote.c |   18 +++++++++---------\n 1 files changed, 9 insertions(+), 9 deletions(-)\n\ndiff --git a/remote.c b/remote.c\nindex 73a38..51853 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -1572,18 +1572,18 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb)\n \tbase = branch->merge[0]->dst;\n \tbase = shorten_unambiguous_ref(base, 0);\n \tif (!num_theirs)\n-\t\tstrbuf_addf(sb, \"Your branch is ahead of '%s' \"\n-\t\t\t    \"by %d commit%s.\\n\",\n-\t\t\t    base, num_ours, (num_ours == 1) ? \"\" : \"s\");\n+\t\tstrbuf_addf(sb, _(\"Your branch is ahead of '%s' \"\n+\t\t\t    \"by %d %s.\\n\"),\n+\t\t\t    base, num_ours, Q_(\"commit\", \"commits\", num_ours));\n \telse if (!num_ours)\n-\t\tstrbuf_addf(sb, \"Your branch is behind '%s' \"\n-\t\t\t    \"by %d commit%s, \"\n-\t\t\t    \"and can be fast-forwarded.\\n\",\n-\t\t\t    base, num_theirs, (num_theirs == 1) ? \"\" : \"s\");\n+\t\tstrbuf_addf(sb, _(\"Your branch is behind '%s' \"\n+\t\t\t    \"by %d %s, \"\n+\t\t\t    \"and can be fast-forwarded.\\n\"),\n+\t\t\t    base, num_theirs, Q_(\"commit\", \"commits\", num_theirs));\n \telse\n-\t\tstrbuf_addf(sb, \"Your branch and '%s' have diverged,\\n\"\n+\t\tstrbuf_addf(sb, _(\"Your branch and '%s' have diverged,\\n\"\n \t\t\t    \"and have %d and %d different commit(s) each, \"\n-\t\t\t    \"respectively.\\n\",\n+\t\t\t    \"respectively.\\n\"),\n \t\t\t    base, num_ours, num_theirs);\n \treturn 1;\n }\n-- \n1.7.9.3.g1fbd7\n"},{"id":"183488","messageId":"CACBZZX6ydnf2n2Y++DCS+ttJYRA_r1FGUzUH-MBVPof65w=Hig@mail.gmail.com","threadId":"29502","inReplyTo":"1328116914-61381-1-git-send-email-worldhello.net@gmail.com","subject":"Re: [PATCH] i18n: format_tracking_info \"Your branch is behind\" message","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2012-02-01T17:39:43Z","receivedAt":"2012-02-01T17:39:43Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Wed, Feb 1, 2012 at 18:21, Jiang Xin <worldhello.net@gmail.com> wrote:\n> Function format_tracking_info in remote.c is called by\n> wt_status_print_tracking in wt-status.c, which will print\n> branch tracking message in git-status. git-checkout also\n> show these messages through it's report_tracking function.\n>\n> Signed-off-by: Jiang Xin <worldhello.net@gmail.com>\n> ---\n>  remote.c |   18 +++++++++---------\n>  1 files changed, 9 insertions(+), 9 deletions(-)\n>\n> diff --git a/remote.c b/remote.c\n> index 73a38..51853 100644\n> --- a/remote.c\n> +++ b/remote.c\n> @@ -1572,18 +1572,18 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb)\n>        base = branch->merge[0]->dst;\n>        base = shorten_unambiguous_ref(base, 0);\n>        if (!num_theirs)\n> -               strbuf_addf(sb, \"Your branch is ahead of '%s' \"\n> -                           \"by %d commit%s.\\n\",\n> -                           base, num_ours, (num_ours == 1) ? \"\" : \"s\");\n> +               strbuf_addf(sb, _(\"Your branch is ahead of '%s' \"\n> +                           \"by %d %s.\\n\"),\n> +                           base, num_ours, Q_(\"commit\", \"commits\", num_ours));\n>        else if (!num_ours)\n> -               strbuf_addf(sb, \"Your branch is behind '%s' \"\n> -                           \"by %d commit%s, \"\n> -                           \"and can be fast-forwarded.\\n\",\n> -                           base, num_theirs, (num_theirs == 1) ? \"\" : \"s\");\n> +               strbuf_addf(sb, _(\"Your branch is behind '%s' \"\n> +                           \"by %d %s, \"\n> +                           \"and can be fast-forwarded.\\n\"),\n> +                           base, num_theirs, Q_(\"commit\", \"commits\", num_theirs));\n\nThese two should be something like:\n\n _Q(\"Your branch is behind '%s' by %d commit\",\n    \"Your branch is behind '%s' by %d commits\",\n    base,\n    num_theirs);\n\nOtherwise we're imposing word order in the translation.\n\n>        else\n> -               strbuf_addf(sb, \"Your branch and '%s' have diverged,\\n\"\n> +               strbuf_addf(sb, _(\"Your branch and '%s' have diverged,\\n\"\n>                            \"and have %d and %d different commit(s) each, \"\n> -                           \"respectively.\\n\",\n> +                           \"respectively.\\n\"),\n>                            base, num_ours, num_theirs);\n\nAnd this is a nice example of where gettext really can't do the right\nthing, it only deals with messages with one numeric counter ;/\n\nIt's probably best to just pick one, probably the latter one.\n"}]}