All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] i18n: TRANSLATORS commends and LEGO--
@ 2012-04-30 15:33 Ævar Arnfjörð Bjarmason
  2012-04-30 15:33 ` [PATCH 1/5] diff: move TRANSLATORS comments so they're picked up Ævar Arnfjörð Bjarmason
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2012-04-30 15:33 UTC (permalink / raw)
  To: git
  Cc: Junio Hamano, Nguyen Thai Ngoc Duy,
	Ævar Arnfjörð Bjarmason

This series fixes/adds some TRANSLATORS commends and removes lego from
some branch/commit messages.

Ævar Arnfjörð Bjarmason (5):
  diff: move TRANSLATORS comments so they're picked up
  i18n: Add more TRANSLATORS comments
  git-branch: remove lego in i18n messages
  git-commit: remove lego in i18n messages
  git-commit: remove lego in i18n messages

 advice.c         |    3 +++
 builtin/branch.c |   24 ++++++++++++--------
 builtin/commit.c |   66 ++++++++++++++++++++++++------------------------------
 bundle.c         |    5 +++++
 commit.c         |    4 ++++
 connected.c      |    3 +++
 diff.c           |   17 +++++++-------
 remote.c         |   10 +++++++++
 sequencer.c      |   10 +++++++++
 9 files changed, 88 insertions(+), 54 deletions(-)

-- 
1.7.10.546.gbaa1a.dirty

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/5] diff: move TRANSLATORS comments so they're picked up
  2012-04-30 15:33 [PATCH 0/5] i18n: TRANSLATORS commends and LEGO-- Ævar Arnfjörð Bjarmason
@ 2012-04-30 15:33 ` Ævar Arnfjörð Bjarmason
  2012-04-30 17:30   ` Junio C Hamano
  2012-04-30 15:33 ` [PATCH 2/5] i18n: Add more TRANSLATORS comments Ævar Arnfjörð Bjarmason
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2012-04-30 15:33 UTC (permalink / raw)
  To: git
  Cc: Junio Hamano, Nguyen Thai Ngoc Duy,
	Ævar Arnfjörð Bjarmason

These TRANSLATORS comments weren't actually picked up by xgettext, the
comment needs to be right before the Q_() function call, evidently it
isn't picked up if that call is wrapped in another function call.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 diff.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/diff.c b/diff.c
index 7da16c9..5d06375 100644
--- a/diff.c
+++ b/diff.c
@@ -1413,22 +1413,22 @@ int print_stat_summary(FILE *fp, int files, int insertions, int deletions)
 	 * but nothing about added/removed lines? Is this a bug in Git?").
 	 */
 	if (insertions || deletions == 0) {
-		/*
-		 * TRANSLATORS: "+" in (+) is a line addition marker;
-		 * do not translate it.
-		 */
 		strbuf_addf(&sb,
+			    /*
+			     * TRANSLATORS: "+" in (+) is a line addition marker;
+			     * do not translate it.
+			     */
 			    Q_(", %d insertion(+)", ", %d insertions(+)",
 			       insertions),
 			    insertions);
 	}
 
 	if (deletions || insertions == 0) {
-		/*
-		 * TRANSLATORS: "-" in (-) is a line removal marker;
-		 * do not translate it.
-		 */
 		strbuf_addf(&sb,
+			    /*
+			     * TRANSLATORS: "-" in (-) is a line removal marker;
+			     * do not translate it.
+			     */
 			    Q_(", %d deletion(-)", ", %d deletions(-)",
 			       deletions),
 			    deletions);
-- 
1.7.10.546.gbaa1a.dirty

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/5] i18n: Add more TRANSLATORS comments
  2012-04-30 15:33 [PATCH 0/5] i18n: TRANSLATORS commends and LEGO-- Ævar Arnfjörð Bjarmason
  2012-04-30 15:33 ` [PATCH 1/5] diff: move TRANSLATORS comments so they're picked up Ævar Arnfjörð Bjarmason
@ 2012-04-30 15:33 ` Ævar Arnfjörð Bjarmason
  2012-04-30 17:37   ` Junio C Hamano
  2012-04-30 15:33 ` [PATCH 3/5] git-branch: remove lego in i18n messages Ævar Arnfjörð Bjarmason
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2012-04-30 15:33 UTC (permalink / raw)
  To: git
  Cc: Junio Hamano, Nguyen Thai Ngoc Duy,
	Ævar Arnfjörð Bjarmason

I took a pass through git.pot and added comments to various messages
that could use one, comments still need to be added to a lot of other
things, but you have to start somewhere.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 advice.c    |    3 +++
 bundle.c    |    5 +++++
 commit.c    |    4 ++++
 connected.c |    3 +++
 diff.c      |    1 +
 remote.c    |   10 ++++++++++
 sequencer.c |   10 ++++++++++
 7 files changed, 36 insertions(+)

diff --git a/advice.c b/advice.c
index a492eea..5944abb 100644
--- a/advice.c
+++ b/advice.c
@@ -37,6 +37,9 @@ void advise(const char *advice, ...)
 
 	for (cp = buf.buf; *cp; cp = np) {
 		np = strchrnul(cp, '\n');
+		/* TRANSLATORS: This will be used to prefix each line of an
+		 * advice message, with the format string being the line
+		 */
 		fprintf(stderr,	_("hint: %.*s\n"), (int)(np - cp), cp);
 		if (*np)
 			np++;
diff --git a/bundle.c b/bundle.c
index 8d31b98..f24999e 100644
--- a/bundle.c
+++ b/bundle.c
@@ -86,6 +86,7 @@ int read_bundle_header(const char *path, struct bundle_header *header)
 	int fd = open(path, O_RDONLY);
 
 	if (fd < 0)
+		/* TRANSLATORS: The argument is a path that can't be opened */
 		return error(_("could not open '%s'"), path);
 	return parse_bundle_header(fd, header, path);
 }
@@ -137,6 +138,9 @@ int verify_bundle(struct bundle_header *header, int verbose)
 	struct object_array refs;
 	struct commit *commit;
 	int i, ret = 0, req_nr;
+	/* TRANSLATORS: This is a heading that'll precede a list of commit
+	 * hashes and reference names
+	 */
 	const char *message = _("Repository lacks these prerequisite commits:");
 
 	init_revisions(&revs, NULL);
@@ -412,6 +416,7 @@ int create_bundle(struct bundle_header *header, const char *path,
 		return error(_("pack-objects died"));
 	if (!bundle_to_stdout) {
 		if (commit_lock_file(&lock))
+			/* TRANSLATORS: The argument is a path we can't create */
 			die_errno(_("cannot create '%s'"), path);
 	}
 	return 0;
diff --git a/commit.c b/commit.c
index 9ed36c7..a4ee4b7 100644
--- a/commit.c
+++ b/commit.c
@@ -45,8 +45,12 @@ struct commit *lookup_commit_or_die(const unsigned char *sha1, const char *ref_n
 {
 	struct commit *c = lookup_commit_reference(sha1);
 	if (!c)
+		/* TRANSLATORS: The argument is a reference name */
 		die(_("could not parse %s"), ref_name);
 	if (hashcmp(sha1, c->object.sha1)) {
+		/* TRANSLATORS: The first argument is a refname, the second is
+		 * a commit hash
+		 */
 		warning(_("%s %s is not a commit!"),
 			ref_name, sha1_to_hex(sha1));
 	}
diff --git a/connected.c b/connected.c
index 1e89c1c..cdd9813 100644
--- a/connected.c
+++ b/connected.c
@@ -45,6 +45,9 @@ int check_everything_connected(sha1_iterate_fn fn, int quiet, void *cb_data)
 		memcpy(commit, sha1_to_hex(sha1), 40);
 		if (write_in_full(rev_list.in, commit, 41) < 0) {
 			if (errno != EPIPE && errno != EINVAL)
+				/* TRANSLATORS: The argument is a strerror()
+				 * message
+				 */
 				error(_("failed write to rev-list: %s"),
 				      strerror(errno));
 			err = -1;
diff --git a/diff.c b/diff.c
index 5d06375..0d4534a 100644
--- a/diff.c
+++ b/diff.c
@@ -3436,6 +3436,7 @@ static int parse_dirstat_opt(struct diff_options *options, const char *params)
 {
 	struct strbuf errmsg = STRBUF_INIT;
 	if (parse_dirstat_params(options, params, &errmsg))
+		/* TRANSLATORS: The argument is an error message */
 		die(_("Failed to parse --dirstat/-X option parameter:\n%s"),
 		    errmsg.buf);
 	strbuf_release(&errmsg);
diff --git a/remote.c b/remote.c
index b296d17..14e7332 100644
--- a/remote.c
+++ b/remote.c
@@ -1604,12 +1604,18 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb)
 	base = shorten_unambiguous_ref(base, 0);
 	if (!num_theirs)
 		strbuf_addf(sb,
+			/* TRANSLATORS: the first argument is a branch name, the
+			 * second is a count of how many commits we're ahead of it
+			 */
 			Q_("Your branch is ahead of '%s' by %d commit.\n",
 			   "Your branch is ahead of '%s' by %d commits.\n",
 			   num_ours),
 			base, num_ours);
 	else if (!num_ours)
 		strbuf_addf(sb,
+			/* TRANSLATORS: the first argument is a branch name, the
+			 * second is a count of how many commits we're behind it
+			 */
 			Q_("Your branch is behind '%s' by %d commit, "
 			       "and can be fast-forwarded.\n",
 			   "Your branch is behind '%s' by %d commits, "
@@ -1618,6 +1624,10 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb)
 			base, num_theirs);
 	else
 		strbuf_addf(sb,
+			/* TRANSLATORS: the first argument is a branch name, the
+			 * second and third arguments are counts of how many
+			 * commits they've diverged by
+			 */
 			Q_("Your branch and '%s' have diverged,\n"
 			       "and have %d and %d different commit each, "
 			       "respectively.\n",
diff --git a/sequencer.c b/sequencer.c
index f83cdfd..b284cf8 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -118,8 +118,14 @@ static void write_cherry_pick_head(struct commit *commit, const char *pseudoref)
 	filename = git_path("%s", pseudoref);
 	fd = open(filename, O_WRONLY | O_CREAT, 0666);
 	if (fd < 0)
+		/* TRANSLATORS: The argument is a filename that can't be
+		 * opened for writing
+		 */
 		die_errno(_("Could not open '%s' for writing"), filename);
 	if (write_in_full(fd, buf.buf, buf.len) != buf.len || close(fd))
+		/* TRANSLATORS: The argument is a filename that can't be
+		 * opened for writing
+		 */
 		die_errno(_("Could not write to '%s'"), filename);
 	strbuf_release(&buf);
 }
@@ -157,6 +163,9 @@ static void write_message(struct strbuf *msgbuf, const char *filename)
 	int msg_fd = hold_lock_file_for_update(&msg_file, filename,
 					       LOCK_DIE_ON_ERROR);
 	if (write_in_full(msg_fd, msgbuf->buf, msgbuf->len) < 0)
+		/* TRANSLATORS: The argument is a filename that can't be
+		 * written to
+		 */
 		die_errno(_("Could not write to %s"), filename);
 	strbuf_release(msgbuf);
 	if (commit_lock_file(&msg_file) < 0)
@@ -365,6 +374,7 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)
 		struct commit_list *p;
 
 		if (!opts->mainline)
+			/* TRANSLATORS: The argument is a commit digest */
 			return error(_("Commit %s is a merge but no -m option was given."),
 				sha1_to_hex(commit->object.sha1));
 
-- 
1.7.10.546.gbaa1a.dirty

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/5] git-branch: remove lego in i18n messages
  2012-04-30 15:33 [PATCH 0/5] i18n: TRANSLATORS commends and LEGO-- Ævar Arnfjörð Bjarmason
  2012-04-30 15:33 ` [PATCH 1/5] diff: move TRANSLATORS comments so they're picked up Ævar Arnfjörð Bjarmason
  2012-04-30 15:33 ` [PATCH 2/5] i18n: Add more TRANSLATORS comments Ævar Arnfjörð Bjarmason
@ 2012-04-30 15:33 ` Ævar Arnfjörð Bjarmason
  2012-04-30 17:38   ` Junio C Hamano
  2012-04-30 15:33 ` [PATCH 4/5] git-commit: " Ævar Arnfjörð Bjarmason
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2012-04-30 15:33 UTC (permalink / raw)
  To: git
  Cc: Junio Hamano, Nguyen Thai Ngoc Duy,
	Ævar Arnfjörð Bjarmason

Instead of making translators translate "remote " and then using
"%sbranch" where "%s" is either "remote " or "" just split the two up
into separate messages. This makes the translation of this section of
git-branch much less confusing.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/branch.c |   24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/builtin/branch.c b/builtin/branch.c
index 5f150b4..8813d2e 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -152,21 +152,22 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
 	struct commit *rev, *head_rev = NULL;
 	unsigned char sha1[20];
 	char *name = NULL;
-	const char *fmt, *remote;
+	const char *fmt;
 	int i;
 	int ret = 0;
+	int remote_branch = 0;
 	struct strbuf bname = STRBUF_INIT;
 
 	switch (kinds) {
 	case REF_REMOTE_BRANCH:
 		fmt = "refs/remotes/%s";
-		/* TRANSLATORS: This is "remote " in "remote branch '%s' not found" */
-		remote = _("remote ");
+		/* For subsequent UI messages */
+		remote_branch = 1;
+
 		force = 1;
 		break;
 	case REF_LOCAL_BRANCH:
 		fmt = "refs/heads/%s";
-		remote = "";
 		break;
 	default:
 		die(_("cannot use -a with -d"));
@@ -190,8 +191,9 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
 
 		name = xstrdup(mkpath(fmt, bname.buf));
 		if (read_ref(name, sha1)) {
-			error(_("%sbranch '%s' not found."),
-					remote, bname.buf);
+			error(remote_branch
+			      ? _("remote branch '%s' not found.")
+			      : _("branch '%s' not found."), bname.buf);
 			ret = 1;
 			continue;
 		}
@@ -212,14 +214,18 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
 		}
 
 		if (delete_ref(name, sha1, 0)) {
-			error(_("Error deleting %sbranch '%s'"), remote,
+			error(remote_branch
+			      ? _("Error deleting remote branch '%s'")
+			      : _("Error deleting branch '%s'"),
 			      bname.buf);
 			ret = 1;
 		} else {
 			struct strbuf buf = STRBUF_INIT;
 			if (!quiet)
-				printf(_("Deleted %sbranch %s (was %s).\n"),
-				       remote, bname.buf,
+				printf(remote_branch
+				       ? _("Deleted remote branch %s (was %s).\n")
+				       : _("Deleted branch %s (was %s).\n"),
+				       bname.buf,
 				       find_unique_abbrev(sha1, DEFAULT_ABBREV));
 			strbuf_addf(&buf, "branch.%s", bname.buf);
 			if (git_config_rename_section(buf.buf, NULL) < 0)
-- 
1.7.10.546.gbaa1a.dirty

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/5] git-commit: remove lego in i18n messages
  2012-04-30 15:33 [PATCH 0/5] i18n: TRANSLATORS commends and LEGO-- Ævar Arnfjörð Bjarmason
                   ` (2 preceding siblings ...)
  2012-04-30 15:33 ` [PATCH 3/5] git-branch: remove lego in i18n messages Ævar Arnfjörð Bjarmason
@ 2012-04-30 15:33 ` Ævar Arnfjörð Bjarmason
  2012-04-30 15:33 ` [PATCH 5/5] " Ævar Arnfjörð Bjarmason
  2012-04-30 15:34 ` [PATCH 0/5] i18n: TRANSLATORS commends and LEGO-- Ævar Arnfjörð Bjarmason
  5 siblings, 0 replies; 12+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2012-04-30 15:33 UTC (permalink / raw)
  To: git
  Cc: Junio Hamano, Nguyen Thai Ngoc Duy,
	Ævar Arnfjörð Bjarmason

Remove the whence_s() function and messages that dependen on it in
favor of messages that use either "merge" or "cherry-pick" directly.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/commit.c |   52 +++++++++++++++++++++++-----------------------------
 1 file changed, 23 insertions(+), 29 deletions(-)

diff --git a/builtin/commit.c b/builtin/commit.c
index b257ae8..c7c491e 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -194,24 +194,6 @@ static void determine_whence(struct wt_status *s)
 		s->whence = whence;
 }
 
-static const char *whence_s(void)
-{
-	const char *s = "";
-
-	switch (whence) {
-	case FROM_COMMIT:
-		break;
-	case FROM_MERGE:
-		s = _("merge");
-		break;
-	case FROM_CHERRY_PICK:
-		s = _("cherry-pick");
-		break;
-	}
-
-	return s;
-}
-
 static void rollback_index_files(void)
 {
 	switch (commit_style) {
@@ -453,8 +435,12 @@ static char *prepare_index(int argc, const char **argv, const char *prefix,
 	 */
 	commit_style = COMMIT_PARTIAL;
 
-	if (whence != FROM_COMMIT)
-		die(_("cannot do a partial commit during a %s."), whence_s());
+	if (whence != FROM_COMMIT) {
+		if (whence == FROM_MERGE)
+			die(_("cannot do a partial commit during a merge."));
+		else if (whence == FROM_CHERRY_PICK)
+			die(_("cannot do a partial commit during a cherry-pick."));
+	}
 
 	memset(&partial, 0, sizeof(partial));
 	partial.strdup_strings = 1;
@@ -796,13 +782,17 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 		char *ai_tmp, *ci_tmp;
 		if (whence != FROM_COMMIT)
 			status_printf_ln(s, GIT_COLOR_NORMAL,
-				_("\n"
-				"It looks like you may be committing a %s.\n"
-				"If this is not correct, please remove the file\n"
-				"	%s\n"
-				"and try again.\n"
-				""),
-				whence_s(),
+			    whence == FROM_MERGE
+				? _("\n"
+					"It looks like you may be committing a merge.\n"
+					"If this is not correct, please remove the file\n"
+					"	%s\n"
+					"and try again.\n")
+				: _("\n"
+					"It looks like you may be committing a cherry-pick.\n"
+					"If this is not correct, please remove the file\n"
+					"	%s\n"
+					"and try again.\n"),
 				git_path(whence == FROM_MERGE
 					 ? "MERGE_HEAD"
 					 : "CHERRY_PICK_HEAD"));
@@ -1072,8 +1062,12 @@ static int parse_and_validate_options(int argc, const char *argv[],
 	/* Sanity check options */
 	if (amend && !current_head)
 		die(_("You have nothing to amend."));
-	if (amend && whence != FROM_COMMIT)
-		die(_("You are in the middle of a %s -- cannot amend."), whence_s());
+	if (amend && whence != FROM_COMMIT) {
+		if (whence == FROM_MERGE)
+			die(_("You are in the middle of a merge -- cannot amend."));
+		else if (whence == FROM_CHERRY_PICK)
+			die(_("You are in the middle of a cherry-pick -- cannot amend."));
+	}
 	if (fixup_message && squash_message)
 		die(_("Options --squash and --fixup cannot be used together"));
 	if (use_message)
-- 
1.7.10.546.gbaa1a.dirty

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 5/5] git-commit: remove lego in i18n messages
  2012-04-30 15:33 [PATCH 0/5] i18n: TRANSLATORS commends and LEGO-- Ævar Arnfjörð Bjarmason
                   ` (3 preceding siblings ...)
  2012-04-30 15:33 ` [PATCH 4/5] git-commit: " Ævar Arnfjörð Bjarmason
@ 2012-04-30 15:33 ` Ævar Arnfjörð Bjarmason
  2012-04-30 17:54   ` Junio C Hamano
  2012-04-30 15:34 ` [PATCH 0/5] i18n: TRANSLATORS commends and LEGO-- Ævar Arnfjörð Bjarmason
  5 siblings, 1 reply; 12+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2012-04-30 15:33 UTC (permalink / raw)
  To: git
  Cc: Junio Hamano, Nguyen Thai Ngoc Duy,
	Ævar Arnfjörð Bjarmason

Change the "Please enter the commit message for your changes." and the
subsequent blurb of text not to be split up. This makes translating it
much easier.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/commit.c |   14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/builtin/commit.c b/builtin/commit.c
index c7c491e..438f257 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -798,17 +798,15 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 					 : "CHERRY_PICK_HEAD"));
 
 		fprintf(s->fp, "\n");
-		status_printf(s, GIT_COLOR_NORMAL,
-			_("Please enter the commit message for your changes."));
 		if (cleanup_mode == CLEANUP_ALL)
-			status_printf_more(s, GIT_COLOR_NORMAL,
-				_(" Lines starting\n"
-				"with '#' will be ignored, and an empty"
+			status_printf(s, GIT_COLOR_NORMAL,
+				_("Please enter the commit message for your changes."
+				" Lines starting\nwith '#' will be ignored, and an empty"
 				" message aborts the commit.\n"));
 		else /* CLEANUP_SPACE, that is. */
-			status_printf_more(s, GIT_COLOR_NORMAL,
-				_(" Lines starting\n"
-				"with '#' will be kept; you may remove them"
+			status_printf(s, GIT_COLOR_NORMAL,
+				_("Please enter the commit message for your changes."
+				" Lines starting\nwith '#' will be kept; you may remove them"
 				" yourself if you want to.\n"
 				"An empty message aborts the commit.\n"));
 		if (only_include_assumed)
-- 
1.7.10.546.gbaa1a.dirty

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/5] i18n: TRANSLATORS commends and LEGO--
  2012-04-30 15:33 [PATCH 0/5] i18n: TRANSLATORS commends and LEGO-- Ævar Arnfjörð Bjarmason
                   ` (4 preceding siblings ...)
  2012-04-30 15:33 ` [PATCH 5/5] " Ævar Arnfjörð Bjarmason
@ 2012-04-30 15:34 ` Ævar Arnfjörð Bjarmason
  5 siblings, 0 replies; 12+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2012-04-30 15:34 UTC (permalink / raw)
  To: git
  Cc: Junio Hamano, Nguyen Thai Ngoc Duy,
	Ævar Arnfjörð Bjarmason

On Mon, Apr 30, 2012 at 17:33, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
> This series fixes/adds some TRANSLATORS commends and removes lego from
> some branch/commit messages.

Oh and of course I forgot this: This is based on next.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/5] diff: move TRANSLATORS comments so they're picked up
  2012-04-30 15:33 ` [PATCH 1/5] diff: move TRANSLATORS comments so they're picked up Ævar Arnfjörð Bjarmason
@ 2012-04-30 17:30   ` Junio C Hamano
  2012-04-30 17:54     ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2012-04-30 17:30 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Nguyen Thai Ngoc Duy

Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> These TRANSLATORS comments weren't actually picked up by xgettext, the
> comment needs to be right before the Q_() function call, evidently it
> isn't picked up if that call is wrapped in another function call.
>
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>

The patch makes sense as an advice to people who update sources where to
place the "TRANSLATORS:" comment, but I am unsure about what this
particular one says. Are we assuming that translators do not know what the
sentence they are translating refers to?

>  		strbuf_addf(&sb,
> +			    /*
> +			     * TRANSLATORS: "+" in (+) is a line addition marker;
> +			     * do not translate it.
> +			     */
>  			    Q_(", %d insertion(+)", ", %d insertions(+)",
>  			       insertions),

What I am getting at is that this may be simply being unnecessarily noisy
by trying to be helpful, and I am not sure if you are drawing the line at
the right level.  For example, "insertion" has many meanings and in the
context of this sentence it means lines added to the old material---should
we mention that here, and tell translators to use the word that conveys
that particular meaning?

For this particular one, I'd be happier if the TRANSLATORS comment told
them to check if "diffstat" (which we borrowed this from) has a l10n of
this message for the language they are translating to, and make sure they
use the same format here.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/5] i18n: Add more TRANSLATORS comments
  2012-04-30 15:33 ` [PATCH 2/5] i18n: Add more TRANSLATORS comments Ævar Arnfjörð Bjarmason
@ 2012-04-30 17:37   ` Junio C Hamano
  0 siblings, 0 replies; 12+ messages in thread
From: Junio C Hamano @ 2012-04-30 17:37 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Nguyen Thai Ngoc Duy

Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> I took a pass through git.pot and added comments to various messages
> that could use one, comments still need to be added to a lot of other
> things, but you have to start somewhere.
>
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>  advice.c    |    3 +++
>  bundle.c    |    5 +++++
>  commit.c    |    4 ++++
>  connected.c |    3 +++
>  diff.c      |    1 +
>  remote.c    |   10 ++++++++++
>  sequencer.c |   10 ++++++++++
>  7 files changed, 36 insertions(+)
>
> diff --git a/advice.c b/advice.c
> index a492eea..5944abb 100644
> --- a/advice.c
> +++ b/advice.c
> @@ -37,6 +37,9 @@ void advise(const char *advice, ...)
>  
>  	for (cp = buf.buf; *cp; cp = np) {
>  		np = strchrnul(cp, '\n');
> +		/* TRANSLATORS: This will be used to prefix each line of an
> +		 * advice message, with the format string being the line
> +		 */

	/*
         * Our multi-line comments are formatted like
         * this (many other places in the patch).
         */

Also end the sentence with a full-stop, please (many other places in the
patch).

It is unclear what "with the format string being the line" means here, at
least to me, even though I think I wrote this code.

>  		fprintf(stderr,	_("hint: %.*s\n"), (int)(np - cp), cp);
>  		if (*np)
>  			np++;
> diff --git a/bundle.c b/bundle.c
> index 8d31b98..f24999e 100644
> --- a/bundle.c
> +++ b/bundle.c
> @@ -86,6 +86,7 @@ int read_bundle_header(const char *path, struct bundle_header *header)
>  	int fd = open(path, O_RDONLY);
>  
>  	if (fd < 0)
> +		/* TRANSLATORS: The argument is a path that can't be opened */
>  		return error(_("could not open '%s'"), path);

That does not add much information.  "path to the file we tried to read
the bundle data from but failed"?

> @@ -137,6 +138,9 @@ int verify_bundle(struct bundle_header *header, int verbose)
>  	struct object_array refs;
>  	struct commit *commit;
>  	int i, ret = 0, req_nr;
> +	/* TRANSLATORS: This is a heading that'll precede a list of commit
> +	 * hashes and reference names
> +	 */

Please say "commit object names" (many other places in the patch).

>  	const char *message = _("Repository lacks these prerequisite commits:");
>  
>  	init_revisions(&revs, NULL);
> @@ -412,6 +416,7 @@ int create_bundle(struct bundle_header *header, const char *path,
>  		return error(_("pack-objects died"));
>  	if (!bundle_to_stdout) {
>  		if (commit_lock_file(&lock))
> +			/* TRANSLATORS: The argument is a path we can't create */
>  			die_errno(_("cannot create '%s'"), path);

That does not add much information.  "path to the file we tried to write
the bundle data to but failed"?

> @@ -365,6 +374,7 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)
>  		struct commit_list *p;
>  
>  		if (!opts->mainline)
> +			/* TRANSLATORS: The argument is a commit digest */

Please consistently say "commit object name".

>  			return error(_("Commit %s is a merge but no -m option was given."),
>  				sha1_to_hex(commit->object.sha1));

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/5] git-branch: remove lego in i18n messages
  2012-04-30 15:33 ` [PATCH 3/5] git-branch: remove lego in i18n messages Ævar Arnfjörð Bjarmason
@ 2012-04-30 17:38   ` Junio C Hamano
  0 siblings, 0 replies; 12+ messages in thread
From: Junio C Hamano @ 2012-04-30 17:38 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: git, Junio Hamano, Nguyen Thai Ngoc Duy

Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> Instead of making translators translate "remote " and then using
> "%sbranch" where "%s" is either "remote " or "" just split the two up
> into separate messages. This makes the translation of this section of
> git-branch much less confusing.
>
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---

Looks good.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/5] diff: move TRANSLATORS comments so they're picked up
  2012-04-30 17:30   ` Junio C Hamano
@ 2012-04-30 17:54     ` Ævar Arnfjörð Bjarmason
  0 siblings, 0 replies; 12+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2012-04-30 17:54 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Nguyen Thai Ngoc Duy

On Mon, Apr 30, 2012 at 19:30, Junio C Hamano <gitster@pobox.com> wrote:
> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
>
>> These TRANSLATORS comments weren't actually picked up by xgettext, the
>> comment needs to be right before the Q_() function call, evidently it
>> isn't picked up if that call is wrapped in another function call.
>>
>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
>
> The patch makes sense as an advice to people who update sources where to
> place the "TRANSLATORS:" comment, but I am unsure about what this
> particular one says. Are we assuming that translators do not know what the
> sentence they are translating refers to?

They'd know if they looked at the source, but the reason for moving
this is that at the previous location the comment wasn't getting
picked up by xgettext.

I.e. before there would be no comment in git.pot and the derived PO
file, now there would be, in practice that means that most translators
will actually see it.

>>               strbuf_addf(&sb,
>> +                         /*
>> +                          * TRANSLATORS: "+" in (+) is a line addition marker;
>> +                          * do not translate it.
>> +                          */
>>                           Q_(", %d insertion(+)", ", %d insertions(+)",
>>                              insertions),
>
> What I am getting at is that this may be simply being unnecessarily noisy
> by trying to be helpful, and I am not sure if you are drawing the line at
> the right level.  For example, "insertion" has many meanings and in the
> context of this sentence it means lines added to the old material---should
> we mention that here, and tell translators to use the word that conveys
> that particular meaning?
>
> For this particular one, I'd be happier if the TRANSLATORS comment told
> them to check if "diffstat" (which we borrowed this from) has a l10n of
> this message for the language they are translating to, and make sure they
> use the same format here.

That makes sense. But for this patch I just wanted to fix things up so
that it was placed in the PO file.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 5/5] git-commit: remove lego in i18n messages
  2012-04-30 15:33 ` [PATCH 5/5] " Ævar Arnfjörð Bjarmason
@ 2012-04-30 17:54   ` Junio C Hamano
  0 siblings, 0 replies; 12+ messages in thread
From: Junio C Hamano @ 2012-04-30 17:54 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: git, Junio Hamano, Nguyen Thai Ngoc Duy

3, 4 and 5 looked all great.  Will queue them.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-04-30 17:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-30 15:33 [PATCH 0/5] i18n: TRANSLATORS commends and LEGO-- Ævar Arnfjörð Bjarmason
2012-04-30 15:33 ` [PATCH 1/5] diff: move TRANSLATORS comments so they're picked up Ævar Arnfjörð Bjarmason
2012-04-30 17:30   ` Junio C Hamano
2012-04-30 17:54     ` Ævar Arnfjörð Bjarmason
2012-04-30 15:33 ` [PATCH 2/5] i18n: Add more TRANSLATORS comments Ævar Arnfjörð Bjarmason
2012-04-30 17:37   ` Junio C Hamano
2012-04-30 15:33 ` [PATCH 3/5] git-branch: remove lego in i18n messages Ævar Arnfjörð Bjarmason
2012-04-30 17:38   ` Junio C Hamano
2012-04-30 15:33 ` [PATCH 4/5] git-commit: " Ævar Arnfjörð Bjarmason
2012-04-30 15:33 ` [PATCH 5/5] " Ævar Arnfjörð Bjarmason
2012-04-30 17:54   ` Junio C Hamano
2012-04-30 15:34 ` [PATCH 0/5] i18n: TRANSLATORS commends and LEGO-- Ævar Arnfjörð Bjarmason

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.