git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiang Xin <worldhello.net@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Git List" <git@vger.kernel.org>,
	"Ævar Arnfjörð" <avarab@gmail.com>,
	"Jiang Xin" <worldhello.net@gmail.com>
Subject: [PATCH] i18n: Not add stripped contents for translation
Date: Mon,  5 Mar 2012 09:21:34 +0800	[thread overview]
Message-ID: <1330910494-17216-1-git-send-email-worldhello.net@gmail.com> (raw)

The last two chars of the concatenate str from the i18n marked strings
(", ") will be stripped out by strbuf_setlen.

        before: "new commits, modified content, "
        end:    "new commits, modified content"

If the translations won't end with COMMA+SPACE, will break the integrity
of the concatenate string. As for Chinese, COMMA+SPACE may translated to
"," -- a 3-byte UTF-8 Chinese comma character.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
---
 wt-status.c |    6 +++---
 1 个文件被修改,插入 3 行(+),删除 3 行(-)

diff --git a/wt-status.c b/wt-status.c
index 9ffc535..0042dbc 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -245,11 +245,11 @@ static void wt_status_print_change_data(struct wt_status *s,
 		if (d->new_submodule_commits || d->dirty_submodule) {
 			strbuf_addstr(&extra, " (");
 			if (d->new_submodule_commits)
-				strbuf_addf(&extra, _("new commits, "));
+				strbuf_addf(&extra, "%s, ", _("new commits"));
 			if (d->dirty_submodule & DIRTY_SUBMODULE_MODIFIED)
-				strbuf_addf(&extra, _("modified content, "));
+				strbuf_addf(&extra, "%s, ", _("modified content"));
 			if (d->dirty_submodule & DIRTY_SUBMODULE_UNTRACKED)
-				strbuf_addf(&extra, _("untracked content, "));
+				strbuf_addf(&extra, "%s, ", _("untracked content"));
 			strbuf_setlen(&extra, extra.len - 2);
 			strbuf_addch(&extra, ')');
 		}
-- 
1.7.9.2.330.g152e4.dirty

             reply	other threads:[~2012-03-05  1:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-05  1:21 Jiang Xin [this message]
2012-03-05  2:27 ` [PATCH] i18n: Not add stripped contents for translation Junio C Hamano
2012-03-05  3:01   ` Jiang Xin
2012-03-05  3:42     ` Junio C Hamano
2012-03-05 19:34       ` Jens Lehmann
2012-03-05 20:08         ` Junio C Hamano
2012-03-06  4:16       ` Jiang Xin
2012-03-06  6:46         ` Junio C Hamano
2012-03-06  6:55           ` Jiang Xin
2012-03-06  6:47         ` Jiang Xin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1330910494-17216-1-git-send-email-worldhello.net@gmail.com \
    --to=worldhello.net@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).