git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH/RFC 0/7] i18n: mark missing C messages
@ 2011-04-10 19:34 Ævar Arnfjörð Bjarmason
  2011-04-10 19:34 ` [PATCH/RFC 1/7] i18n: mark init-db messages for translation Ævar Arnfjörð Bjarmason
                   ` (7 more replies)
  0 siblings, 8 replies; 21+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-04-10 19:34 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Some messages fell through the cracks during the later submissions of
the i18n series, hopefully this catches all of the remaining C
messsages.

This is an RFC because the first patch still leaves one remaining
gitdir test failing under GETTEXT_POISON, and I won't be able to find
out why tonight. Help welcome with figuring out why (in which case
this should all be OK), you just need too build with
GETTEXT_POISON=YesPlease and run t/t0001-init.sh.

Ævar Arnfjörð Bjarmason (7):
  i18n: mark init-db messages for translation
  i18n: mark merge "Could not read from" message for translation
  i18n: mark merge "upstream" messages for translation
  i18n: mark merge CHERRY_PICK_HEAD messages for translation
  i18n: mark clone nonexistent repository  message for translation
  i18n: mark checkout --detach messages for translation
  i18n: mark checkout plural warning for translation

 builtin/checkout.c         |   24 ++++++++++++++++++------
 builtin/clone.c            |    2 +-
 builtin/init-db.c          |   12 ++++++------
 builtin/merge.c            |   16 ++++++++--------
 t/t0001-init.sh            |   28 ++++++++++++++++++++--------
 t/t2020-checkout-detach.sh |   15 ++++++++++++---
 t/t5601-clone.sh           |    7 +++++--
 7 files changed, 70 insertions(+), 34 deletions(-)

-- 
1.7.4.1

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

* [PATCH/RFC 1/7] i18n: mark init-db messages for translation
  2011-04-10 19:34 [PATCH/RFC 0/7] i18n: mark missing C messages Ævar Arnfjörð Bjarmason
@ 2011-04-10 19:34 ` Ævar Arnfjörð Bjarmason
  2011-04-12  7:12   ` Junio C Hamano
  2011-04-10 19:34 ` [PATCH/RFC 2/7] i18n: mark merge "Could not read from" message for translation Ævar Arnfjörð Bjarmason
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 21+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-04-10 19:34 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Mark the init-db messages that were added in v1.7.5-rc1~16^2 (init,
clone: support --separate-git-dir for .git file) by Nguyễn Thái Ngọc
Duy for translation.

This requires splitting up the tests that the patch added so that
certain parts of them can be skipped unless the C_LOCALE_OUTPUT
prerequisite is satisfied.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/init-db.c |   12 ++++++------
 t/t0001-init.sh   |   28 ++++++++++++++++++++--------
 t/t5601-clone.sh  |    7 +++++--
 3 files changed, 31 insertions(+), 16 deletions(-)

diff --git a/builtin/init-db.c b/builtin/init-db.c
index b7370d9..6d0a856 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -319,10 +319,10 @@ int set_git_dir_init(const char *git_dir, const char *real_git_dir,
 		struct stat st;
 
 		if (!exist_ok && !stat(git_dir, &st))
-			die("%s already exists", git_dir);
+			die(_("%s already exists"), git_dir);
 
 		if (!exist_ok && !stat(real_git_dir, &st))
-			die("%s already exists", real_git_dir);
+			die(_("%s already exists"), real_git_dir);
 
 		/*
 		 * make sure symlinks are resolved because we'll be
@@ -351,16 +351,16 @@ static void separate_git_dir(const char *git_dir)
 		else if (S_ISDIR(st.st_mode))
 			src = git_link;
 		else
-			die("unable to handle file type %d", st.st_mode);
+			die(_("unable to handle file type %d"), st.st_mode);
 
 		if (rename(src, git_dir))
-			die_errno("unable to move %s to %s", src, git_dir);
+			die_errno(_("unable to move %s to %s"), src, git_dir);
 	}
 
 	fp = fopen(git_link, "w");
 	if (!fp)
-		die("Could not create git link %s", git_link);
-	fprintf(fp, "gitdir: %s\n", git_dir);
+		die(_("Could not create git link %s"), git_link);
+	fprintf(fp, _("gitdir: %s\n"), git_dir);
 	fclose(fp);
 }
 
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index a5816d0..fa31cbd 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -374,22 +374,28 @@ test_expect_success 'init prefers command line to GIT_DIR' '
 test_expect_success 'init with separate gitdir' '
 	rm -rf newdir &&
 	git init --separate-git-dir realgitdir newdir &&
-	echo "gitdir: `pwd`/realgitdir" >expected &&
-	test_cmp expected newdir/.git &&
 	test -d realgitdir/refs
 '
 
+test_expect_success C_LOCALE_OUTPUT 'init with separate gitdir: output' '
+	echo "gitdir: `pwd`/realgitdir" >expected &&
+	test_cmp expected newdir/.git
+'
+
 test_expect_success 're-init to update git link' '
 	(
 	cd newdir &&
 	git init --separate-git-dir ../surrealgitdir
 	) &&
-	echo "gitdir: `pwd`/surrealgitdir" >expected &&
-	test_cmp expected newdir/.git &&
 	test -d surrealgitdir/refs &&
 	! test -d realgitdir/refs
 '
 
+test_expect_success C_LOCALE_OUTPUT 're-init to update git link: output' '
+	echo "gitdir: `pwd`/surrealgitdir" >expected &&
+	test_cmp expected newdir/.git
+'
+
 test_expect_success 're-init to move gitdir' '
 	rm -rf newdir realgitdir surrealgitdir &&
 	git init newdir &&
@@ -397,11 +403,14 @@ test_expect_success 're-init to move gitdir' '
 	cd newdir &&
 	git init --separate-git-dir ../realgitdir
 	) &&
-	echo "gitdir: `pwd`/realgitdir" >expected &&
-	test_cmp expected newdir/.git &&
 	test -d realgitdir/refs
 '
 
+test_expect_success C_LOCALE_OUTPUT 're-init to move gitdir: output' '
+	echo "gitdir: `pwd`/realgitdir" >expected &&
+	test_cmp expected newdir/.git
+'
+
 test_expect_success 're-init to move gitdir symlink' '
 	rm -rf newdir realgitdir &&
 	git init newdir &&
@@ -411,10 +420,13 @@ test_expect_success 're-init to move gitdir symlink' '
 	ln -s here .git &&
 	git init -L ../realgitdir
 	) &&
-	echo "gitdir: `pwd`/realgitdir" >expected &&
-	test_cmp expected newdir/.git &&
 	test -d realgitdir/refs &&
 	! test -d newdir/here
 '
 
+test_expect_success C_LOCALE_OUTPUT 're-init to move gitdir symlink: output' '
+	echo "gitdir: `pwd`/realgitdir" >expected &&
+	test_cmp expected newdir/.git
+'
+
 test_done
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 5a068b2..a50e36e 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -194,11 +194,14 @@ test_expect_success 'do not respect url-encoding of non-url path' '
 test_expect_success 'clone separate gitdir' '
 	rm -rf dst &&
 	git clone --separate-git-dir realgitdir src dst &&
-	echo "gitdir: `pwd`/realgitdir" >expected &&
-	test_cmp expected dst/.git &&
 	test -d realgitdir/refs
 '
 
+test_expect_success C_LOCALE_OUTPUT 'clone separate gitdir: output' '
+	echo "gitdir: `pwd`/realgitdir" >expected &&
+	test_cmp expected dst/.git
+'
+
 test_expect_success 'clone separate gitdir where target already exists' '
 	rm -rf dst &&
 	test_must_fail git clone --separate-git-dir realgitdir src dst
-- 
1.7.4.1

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

* [PATCH/RFC 2/7] i18n: mark merge "Could not read from" message for translation
  2011-04-10 19:34 [PATCH/RFC 0/7] i18n: mark missing C messages Ævar Arnfjörð Bjarmason
  2011-04-10 19:34 ` [PATCH/RFC 1/7] i18n: mark init-db messages for translation Ævar Arnfjörð Bjarmason
@ 2011-04-10 19:34 ` Ævar Arnfjörð Bjarmason
  2011-04-10 19:34 ` [PATCH/RFC 3/7] i18n: mark merge "upstream" messages " Ævar Arnfjörð Bjarmason
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 21+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-04-10 19:34 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Mark the "Could not read from '%s'" message that was added to
builtin/merge.c in v1.7.4.2~25^2 (merge: honor prepare-commit-msg
hook) by Jay Soffian for translation.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/merge.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin/merge.c b/builtin/merge.c
index d54e7dd..7eda05d 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -822,7 +822,7 @@ static void read_merge_msg(void)
 {
 	strbuf_reset(&merge_msg);
 	if (strbuf_read_file(&merge_msg, git_path("MERGE_MSG"), 0) < 0)
-		die_errno("Could not read from '%s'", git_path("MERGE_MSG"));
+		die_errno(_("Could not read from '%s'"), git_path("MERGE_MSG"));
 }
 
 static void run_prepare_commit_msg(void)
-- 
1.7.4.1

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

* [PATCH/RFC 3/7] i18n: mark merge "upstream" messages for translation
  2011-04-10 19:34 [PATCH/RFC 0/7] i18n: mark missing C messages Ævar Arnfjörð Bjarmason
  2011-04-10 19:34 ` [PATCH/RFC 1/7] i18n: mark init-db messages for translation Ævar Arnfjörð Bjarmason
  2011-04-10 19:34 ` [PATCH/RFC 2/7] i18n: mark merge "Could not read from" message for translation Ævar Arnfjörð Bjarmason
@ 2011-04-10 19:34 ` Ævar Arnfjörð Bjarmason
  2011-04-10 19:34 ` [PATCH/RFC 4/7] i18n: mark merge CHERRY_PICK_HEAD " Ævar Arnfjörð Bjarmason
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 21+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-04-10 19:34 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Mark the merge messages that were added in v1.7.5-rc1~17^2 (merge:
merge with the default upstream branch without argument) by Junio C
Hamano for translation.

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

diff --git a/builtin/merge.c b/builtin/merge.c
index 7eda05d..6e63c08 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -962,16 +962,16 @@ static int setup_with_upstream(const char ***argv)
 	const char **args;
 
 	if (!branch)
-		die("No current branch.");
+		die(_("No current branch."));
 	if (!branch->remote)
-		die("No remote for the current branch.");
+		die(_("No remote for the current branch."));
 	if (!branch->merge_nr)
-		die("No default upstream defined for the current branch.");
+		die(_("No default upstream defined for the current branch."));
 
 	args = xcalloc(branch->merge_nr + 1, sizeof(char *));
 	for (i = 0; i < branch->merge_nr; i++) {
 		if (!branch->merge[i]->dst)
-			die("No remote tracking branch for %s from %s",
+			die(_("No remote tracking branch for %s from %s"),
 			    branch->merge[i]->src, branch->remote_name);
 		args[i] = branch->merge[i]->dst;
 	}
-- 
1.7.4.1

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

* [PATCH/RFC 4/7] i18n: mark merge CHERRY_PICK_HEAD messages for translation
  2011-04-10 19:34 [PATCH/RFC 0/7] i18n: mark missing C messages Ævar Arnfjörð Bjarmason
                   ` (2 preceding siblings ...)
  2011-04-10 19:34 ` [PATCH/RFC 3/7] i18n: mark merge "upstream" messages " Ævar Arnfjörð Bjarmason
@ 2011-04-10 19:34 ` Ævar Arnfjörð Bjarmason
  2011-04-10 19:34 ` [PATCH/RFC 5/7] i18n: mark clone nonexistent repository message " Ævar Arnfjörð Bjarmason
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 21+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-04-10 19:34 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Mark CHERRY_PICK_HEAD related messages in builtin/merge.c that were
added in v1.7.5-rc0~88^2~2 (Introduce CHERRY_PICK_HEAD) by Jay Soffian
for translation.

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

diff --git a/builtin/merge.c b/builtin/merge.c
index 6e63c08..08245b6 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -1043,10 +1043,10 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 	}
 	if (file_exists(git_path("CHERRY_PICK_HEAD"))) {
 		if (advice_resolve_conflict)
-			die("You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists).\n"
-			    "Please, commit your changes before you can merge.");
+			die(_("You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists).\n"
+			    "Please, commit your changes before you can merge."));
 		else
-			die("You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists).");
+			die(_("You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists)."));
 	}
 	resolve_undo_clear();
 
-- 
1.7.4.1

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

* [PATCH/RFC 5/7] i18n: mark clone nonexistent repository  message for translation
  2011-04-10 19:34 [PATCH/RFC 0/7] i18n: mark missing C messages Ævar Arnfjörð Bjarmason
                   ` (3 preceding siblings ...)
  2011-04-10 19:34 ` [PATCH/RFC 4/7] i18n: mark merge CHERRY_PICK_HEAD " Ævar Arnfjörð Bjarmason
@ 2011-04-10 19:34 ` Ævar Arnfjörð Bjarmason
  2011-04-10 19:34 ` [PATCH/RFC 6/7] i18n: mark checkout --detach messages " Ævar Arnfjörð Bjarmason
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 21+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-04-10 19:34 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Mark the "repository '%s' does not exist" message added in
v1.7.4.2~21^2 (clone: die when trying to clone missing local path) by
Jeff King for translation.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/clone.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin/clone.c b/builtin/clone.c
index 4144bcf..49c838f 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -417,7 +417,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 	if (path)
 		repo = xstrdup(absolute_path(repo_name));
 	else if (!strchr(repo_name, ':'))
-		die("repository '%s' does not exist", repo_name);
+		die(_("repository '%s' does not exist"), repo_name);
 	else
 		repo = repo_name;
 	is_local = path && !is_bundle;
-- 
1.7.4.1

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

* [PATCH/RFC 6/7] i18n: mark checkout --detach messages for translation
  2011-04-10 19:34 [PATCH/RFC 0/7] i18n: mark missing C messages Ævar Arnfjörð Bjarmason
                   ` (4 preceding siblings ...)
  2011-04-10 19:34 ` [PATCH/RFC 5/7] i18n: mark clone nonexistent repository message " Ævar Arnfjörð Bjarmason
@ 2011-04-10 19:34 ` Ævar Arnfjörð Bjarmason
  2011-04-10 19:34 ` [PATCH/RFC 7/7] i18n: mark checkout plural warning " Ævar Arnfjörð Bjarmason
  2011-04-12  7:27 ` [PATCH/RFC 0/7] i18n: mark missing C messages Junio C Hamano
  7 siblings, 0 replies; 21+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-04-10 19:34 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Mark messages added in v1.7.5-rc0~117^2~2 (checkout: introduce
--detach synonym for "git checkout foo^{commit}") by Junio C Hamano
for translation.

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

diff --git a/builtin/checkout.c b/builtin/checkout.c
index eece5d6..0b65edd 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -961,9 +961,9 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
 		die (_("--patch is incompatible with all other options"));
 
 	if (opts.force_detach && (opts.new_branch || opts.new_orphan_branch))
-		die("--detach cannot be used with -b/-B/--orphan");
+		die(_("--detach cannot be used with -b/-B/--orphan"));
 	if (opts.force_detach && 0 < opts.track)
-		die("--detach cannot be used with -t");
+		die(_("--detach cannot be used with -t"));
 
 	/* --track without -b should DWIM */
 	if (0 < opts.track && !opts.new_branch) {
@@ -1043,7 +1043,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
 		}
 
 		if (opts.force_detach)
-			die("git checkout: --detach does not take a path argument");
+			die(_("git checkout: --detach does not take a path argument"));
 
 		if (1 < !!opts.writeout_stage + !!opts.force + !!opts.merge)
 			die(_("git checkout: --ours/--theirs, --force and --merge are incompatible when\nchecking out of the index."));
-- 
1.7.4.1

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

* [PATCH/RFC 7/7] i18n: mark checkout plural warning for translation
  2011-04-10 19:34 [PATCH/RFC 0/7] i18n: mark missing C messages Ævar Arnfjörð Bjarmason
                   ` (5 preceding siblings ...)
  2011-04-10 19:34 ` [PATCH/RFC 6/7] i18n: mark checkout --detach messages " Ævar Arnfjörð Bjarmason
@ 2011-04-10 19:34 ` Ævar Arnfjörð Bjarmason
  2011-04-12  7:19   ` Junio C Hamano
  2011-04-12  7:27 ` [PATCH/RFC 0/7] i18n: mark missing C messages Junio C Hamano
  7 siblings, 1 reply; 21+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-04-10 19:34 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Mark the "Warning: you are leaving %d commit(s) behind" message added
in v1.7.5-rc0~74^2 (commit: give final warning when reattaching HEAD
to leave commits behind) by Junio C Hamano for translation.

This message requires the use of ngettext() features, and is the first
message to use the Q_() wrapper around ngettext().

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/checkout.c         |   18 +++++++++++++++---
 t/t2020-checkout-detach.sh |   15 ++++++++++++---
 2 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/builtin/checkout.c b/builtin/checkout.c
index 0b65edd..5e94720 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -648,18 +648,30 @@ static void suggest_reattach(struct commit *commit, struct rev_info *revs)
 		if (more == 1)
 			describe_one_orphan(&sb, last);
 		else
-			strbuf_addf(&sb, " ... and %d more.\n", more);
+			strbuf_addf(&sb, _(" ... and %d more.\n"), more);
 	}
 
 	fprintf(stderr,
-		"Warning: you are leaving %d commit%s behind, "
+		Q_(
+		/* The singular version */
+		"Warning: you are leaving %d commit behind, "
 		"not connected to\n"
 		"any of your branches:\n\n"
 		"%s\n"
 		"If you want to keep them by creating a new branch, "
 		"this may be a good time\nto do so with:\n\n"
 		" git branch new_branch_name %s\n\n",
-		lost, ((1 < lost) ? "s" : ""),
+		/* The plural version */
+		"Warning: you are leaving %d commits behind, "
+		"not connected to\n"
+		"any of your branches:\n\n"
+		"%s\n"
+		"If you want to keep them by creating a new branch, "
+		"this may be a good time\nto do so with:\n\n"
+		" git branch new_branch_name %s\n\n",
+		/* Give ngettext() the count */
+		lost),
+		lost,
 		sb.buf,
 		sha1_to_hex(commit->object.sha1));
 	strbuf_release(&sb);
diff --git a/t/t2020-checkout-detach.sh b/t/t2020-checkout-detach.sh
index 569b27f..ab782e2 100755
--- a/t/t2020-checkout-detach.sh
+++ b/t/t2020-checkout-detach.sh
@@ -108,21 +108,30 @@ test_expect_success 'checkout warns on orphan commits' '
 	echo content >orphan &&
 	git add orphan &&
 	git commit -a -m orphan &&
-	git checkout master 2>stderr &&
+	git checkout master 2>stderr
+'
+
+test_expect_success C_LOCALE_OUTPUT 'checkout warns on orphan commits: output' '
 	check_orphan_warning stderr
 '
 
 test_expect_success 'checkout does not warn leaving ref tip' '
 	reset &&
 	git checkout --detach two &&
-	git checkout master 2>stderr &&
+	git checkout master 2>stderr
+'
+
+test_expect_success C_LOCALE_OUTPUT 'checkout does not warn leaving ref tip' '
 	check_no_orphan_warning stderr
 '
 
 test_expect_success 'checkout does not warn leaving reachable commit' '
 	reset &&
 	git checkout --detach HEAD^ &&
-	git checkout master 2>stderr &&
+	git checkout master 2>stderr
+'
+
+test_expect_success C_LOCALE_OUTPUT 'checkout does not warn leaving reachable commit' '
 	check_no_orphan_warning stderr
 '
 
-- 
1.7.4.1

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

* Re: [PATCH/RFC 1/7] i18n: mark init-db messages for translation
  2011-04-10 19:34 ` [PATCH/RFC 1/7] i18n: mark init-db messages for translation Ævar Arnfjörð Bjarmason
@ 2011-04-12  7:12   ` Junio C Hamano
  2011-04-12  7:15     ` Junio C Hamano
  0 siblings, 1 reply; 21+ messages in thread
From: Junio C Hamano @ 2011-04-12  7:12 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git

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

>  	fp = fopen(git_link, "w");
>  	if (!fp)
> -		die("Could not create git link %s", git_link);
> -	fprintf(fp, "gitdir: %s\n", git_dir);
> +		die(_("Could not create git link %s"), git_link);
> +	fprintf(fp, _("gitdir: %s\n"), git_dir);
>  	fclose(fp);
>  }
>  
> diff --git a/t/t0001-init.sh b/t/t0001-init.sh
> index a5816d0..fa31cbd 100755
> --- a/t/t0001-init.sh
> +++ b/t/t0001-init.sh
> @@ -374,22 +374,28 @@ test_expect_success 'init prefers command line to GIT_DIR' '
>  test_expect_success 'init with separate gitdir' '
>  	rm -rf newdir &&
>  	git init --separate-git-dir realgitdir newdir &&
> -	echo "gitdir: `pwd`/realgitdir" >expected &&
> -	test_cmp expected newdir/.git &&
>  	test -d realgitdir/refs
>  '
>  
> +test_expect_success C_LOCALE_OUTPUT 'init with separate gitdir: output' '
> +	echo "gitdir: `pwd`/realgitdir" >expected &&
> +	test_cmp expected newdir/.git
> +'

I don't think this is correct.  The file "git_link" refers to .git that is
not a directory but is a regular file whose contents is "gitdir: $path"
and that should _never_ be localized, so the patch to die() message is Ok,
but the string given to fprintf(fp, ...) is _not_.

And t0001 should compare the expected output with "gitdir: $path"
regardless of the poisoning.

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

* Re: [PATCH/RFC 1/7] i18n: mark init-db messages for translation
  2011-04-12  7:12   ` Junio C Hamano
@ 2011-04-12  7:15     ` Junio C Hamano
  2011-04-12  7:44       ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 21+ messages in thread
From: Junio C Hamano @ 2011-04-12  7:15 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git

Junio C Hamano <gitster@pobox.com> writes:

> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>
>>  	fp = fopen(git_link, "w");
>>  	if (!fp)
>> -		die("Could not create git link %s", git_link);
>> -	fprintf(fp, "gitdir: %s\n", git_dir);
>> +		die(_("Could not create git link %s"), git_link);
>> +	fprintf(fp, _("gitdir: %s\n"), git_dir);
>>  	fclose(fp);
>> ...
> I don't think this is correct.  The file "git_link" refers to .git that is
> not a directory but is a regular file whose contents is "gitdir: $path"
> and that should _never_ be localized, so the patch to die() message is Ok,
> but the string given to fprintf(fp, ...) is _not_.

See read_gitfile_gently() in setup.c; that is the reader of the
information contained in this file.

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

* Re: [PATCH/RFC 7/7] i18n: mark checkout plural warning for translation
  2011-04-10 19:34 ` [PATCH/RFC 7/7] i18n: mark checkout plural warning " Ævar Arnfjörð Bjarmason
@ 2011-04-12  7:19   ` Junio C Hamano
  2011-04-12  7:54     ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 21+ messages in thread
From: Junio C Hamano @ 2011-04-12  7:19 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano

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

> Mark the "Warning: you are leaving %d commit(s) behind" message added
> in v1.7.5-rc0~74^2 (commit: give final warning when reattaching HEAD
> to leave commits behind) by Junio C Hamano for translation.
>
> This message requires the use of ngettext() features, and is the first
> message to use the Q_() wrapper around ngettext().

Thanks.

>  	fprintf(stderr,
> +		Q_(
> +		/* The singular version */
> +		"Warning: you are leaving %d commit behind, "
>  		"not connected to\n"
>  		"any of your branches:\n\n"
>  		"%s\n"
>  		"If you want to keep them by creating a new branch, "

s/them/it/ as this is a singular case, no?

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

* Re: [PATCH/RFC 0/7] i18n: mark missing C messages
  2011-04-10 19:34 [PATCH/RFC 0/7] i18n: mark missing C messages Ævar Arnfjörð Bjarmason
                   ` (6 preceding siblings ...)
  2011-04-10 19:34 ` [PATCH/RFC 7/7] i18n: mark checkout plural warning " Ævar Arnfjörð Bjarmason
@ 2011-04-12  7:27 ` Junio C Hamano
  7 siblings, 0 replies; 21+ messages in thread
From: Junio C Hamano @ 2011-04-12  7:27 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git

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

> This is an RFC because the first patch still leaves one remaining
> gitdir test failing under GETTEXT_POISON, and I won't be able to find
> out why tonight. Help welcome with figuring out why (in which case
> this should all be OK), you just need too build with
> GETTEXT_POISON=YesPlease and run t/t0001-init.sh.

I didn't even compile test this one, but I highly suspect that all the
failures you saw come from the fact that .git file your patch produces
with gettext poisoning (or any l10n) would be malformed and cannot be
parsed by read_gitfile_gently() anymore.

I took a look at the remainder of the series, and except for the "do not
call what you know is a singleton 'them'" grammo, everything looked fine
to me.

I am tempted to merge them to 'master' before rc2; the alternative is to
queue it on ab/i18n-fixup and keep it in 'next' until the 1.7.5 final, and
have other people build on top of ab/i18n-fixup topic.

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

* Re: [PATCH/RFC 1/7] i18n: mark init-db messages for translation
  2011-04-12  7:15     ` Junio C Hamano
@ 2011-04-12  7:44       ` Ævar Arnfjörð Bjarmason
  2011-04-12 18:20         ` Junio C Hamano
  0 siblings, 1 reply; 21+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-04-12  7:44 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Tue, Apr 12, 2011 at 09:15, Junio C Hamano <gitster@pobox.com> wrote:
> Junio C Hamano <gitster@pobox.com> writes:
>
>> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>>
>>>      fp = fopen(git_link, "w");
>>>      if (!fp)
>>> -            die("Could not create git link %s", git_link);
>>> -    fprintf(fp, "gitdir: %s\n", git_dir);
>>> +            die(_("Could not create git link %s"), git_link);
>>> +    fprintf(fp, _("gitdir: %s\n"), git_dir);
>>>      fclose(fp);
>>> ...
>> I don't think this is correct.  The file "git_link" refers to .git that is
>> not a directory but is a regular file whose contents is "gitdir: $path"
>> and that should _never_ be localized, so the patch to die() message is Ok,
>> but the string given to fprintf(fp, ...) is _not_.
>
> See read_gitfile_gently() in setup.c; that is the reader of the
> information contained in this file.

Ah, thanks. Missed that. I'd have spotted it if I dug down instead of sending.

I'll re-send one without the translation for this plumbing message.

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

* Re: [PATCH/RFC 7/7] i18n: mark checkout plural warning for translation
  2011-04-12  7:19   ` Junio C Hamano
@ 2011-04-12  7:54     ` Ævar Arnfjörð Bjarmason
  2011-04-12 20:57       ` Junio C Hamano
  0 siblings, 1 reply; 21+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-04-12  7:54 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Tue, Apr 12, 2011 at 09:19, Junio C Hamano <gitster@pobox.com> wrote:
> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
>
>> Mark the "Warning: you are leaving %d commit(s) behind" message added
>> in v1.7.5-rc0~74^2 (commit: give final warning when reattaching HEAD
>> to leave commits behind) by Junio C Hamano for translation.
>>
>> This message requires the use of ngettext() features, and is the first
>> message to use the Q_() wrapper around ngettext().
>
> Thanks.
>
>>       fprintf(stderr,
>> +             Q_(
>> +             /* The singular version */
>> +             "Warning: you are leaving %d commit behind, "
>>               "not connected to\n"
>>               "any of your branches:\n\n"
>>               "%s\n"
>>               "If you want to keep them by creating a new branch, "
>
> s/them/it/ as this is a singular case, no?

I just used the message as-is, we were using that for the singular before.

But maybe we should change that. Fix it up at your discretion.

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

* Re: [PATCH/RFC 1/7] i18n: mark init-db messages for translation
  2011-04-12  7:44       ` Ævar Arnfjörð Bjarmason
@ 2011-04-12 18:20         ` Junio C Hamano
  2011-04-12 22:55           ` Junio C Hamano
  0 siblings, 1 reply; 21+ messages in thread
From: Junio C Hamano @ 2011-04-12 18:20 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git

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

> Ah, thanks. Missed that. I'd have spotted it if I dug down instead of sending.
>
> I'll re-send one without the translation for this plumbing message.

No need to resend, if the reroll is just the removal of the part that
marks the fprintf() argument, and sprinkles t0001 with C_LOCALE_OUTPUT
to skip checking of the contents of .git file.

By the way, don't you think the attached is far easier to read than
artificially breaking a single test into "do" and "check" phase?  The
majority of the l10n dependent tests can and should lose C_LOCALE_OUTPUT
prerequisite and use this instead for far superiour readability, I think.

At least this makes it far more pleasant to read both the actual script
and the output in non-poison cases.

 t/test-lib.sh               |    8 ++++
 t/t5526-fetch-submodules.sh |   93 ++++++++++++++++--------------------------
 2 files changed, 44 insertions(+), 57 deletions(-)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index abc47f3..3e7c2bb 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1077,6 +1077,14 @@ else
 	test_set_prereq C_LOCALE_OUTPUT
 fi
 
+# Use this instead of test_cmp to compare files that contain expected and
+# actual output from git commands that can be translated.  When running
+# under GETTEXT_POISON this pretends that the command produced expected
+# results.
+test_i18ncmp () {
+	test -n "$GETTEXT_POISON" || test_cmp "$@"
+}
+
 # test whether the filesystem supports symbolic links
 ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS
 rm -f y
diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh
index af78e21..a1fddd4 100755
--- a/t/t5526-fetch-submodules.sh
+++ b/t/t5526-fetch-submodules.sh
@@ -66,12 +66,9 @@ test_expect_success "fetch --recurse-submodules recurses into submodules" '
 	(
 		cd downstream &&
 		git fetch --recurse-submodules >../actual.out 2>../actual.err
-	)
-'
-
-test_expect_success C_LOCALE_OUTPUT "fetch --recurse-submodules recurses into submodules: output" '
-	test_cmp expect.out actual.out &&
-	test_cmp expect.err actual.err
+	) &&
+	test_i18ncmp expect.out actual.out &&
+	test_i18ncmp expect.err actual.err
 '
 
 test_expect_success "fetch alone only fetches superproject" '
@@ -98,12 +95,9 @@ test_expect_success "using fetchRecurseSubmodules=true in .gitmodules recurses i
 		cd downstream &&
 		git config -f .gitmodules submodule.submodule.fetchRecurseSubmodules true &&
 		git fetch >../actual.out 2>../actual.err
-	)
-'
-
-test_expect_success C_LOCALE_OUTPUT "using fetchRecurseSubmodules=true in .gitmodules recurses into submodules" '
-	test_cmp expect.out actual.out &&
-	test_cmp expect.err actual.err
+	) &&
+	test_i18ncmp expect.out actual.out &&
+	test_i18ncmp expect.err actual.err
 '
 
 test_expect_success "--no-recurse-submodules overrides .gitmodules config" '
@@ -132,12 +126,9 @@ test_expect_success "--recurse-submodules overrides fetchRecurseSubmodules setti
 		git fetch --recurse-submodules >../actual.out 2>../actual.err &&
 		git config --unset -f .gitmodules submodule.submodule.fetchRecurseSubmodules &&
 		git config --unset submodule.submodule.fetchRecurseSubmodules
-	)
-'
-
-test_expect_success C_LOCALE_OUTPUT "--recurse-submodules overrides fetchRecurseSubmodules setting from .git/config: output" '
-	test_cmp expect.out actual.out &&
-	test_cmp expect.err actual.err
+	) &&
+	test_i18ncmp expect.out actual.out &&
+	test_i18ncmp expect.err actual.err
 '
 
 test_expect_success "--quiet propagates to submodules" '
@@ -154,24 +145,18 @@ test_expect_success "--dry-run propagates to submodules" '
 	(
 		cd downstream &&
 		git fetch --recurse-submodules --dry-run >../actual.out 2>../actual.err
-	)
-'
-
-test_expect_success C_LOCALE_OUTPUT "--dry-run propagates to submodules: output" '
-	test_cmp expect.out actual.out &&
-	test_cmp expect.err actual.err
+	) &&
+	test_i18ncmp expect.out actual.out &&
+	test_i18ncmp expect.err actual.err
 '
 
 test_expect_success "Without --dry-run propagates to submodules" '
 	(
 		cd downstream &&
 		git fetch --recurse-submodules >../actual.out 2>../actual.err
-	)
-'
-
-test_expect_success C_LOCALE_OUTPUT "Without --dry-run propagates to submodules: output" '
-	test_cmp expect.out actual.out &&
-	test_cmp expect.err actual.err
+	) &&
+	test_i18ncmp expect.out actual.out &&
+	test_i18ncmp expect.err actual.err
 '
 
 test_expect_success "recurseSubmodules=true propagates into submodules" '
@@ -180,12 +165,9 @@ test_expect_success "recurseSubmodules=true propagates into submodules" '
 		cd downstream &&
 		git config fetch.recurseSubmodules true
 		git fetch >../actual.out 2>../actual.err
-	)
-'
-
-test_expect_success C_LOCALE_OUTPUT "recurseSubmodules=true propagates into submodules: output" '
-	test_cmp expect.out actual.out &&
-	test_cmp expect.err actual.err
+	) &&
+	test_i18ncmp expect.out actual.out &&
+	test_i18ncmp expect.err actual.err
 '
 
 test_expect_success "--recurse-submodules overrides config in submodule" '
@@ -197,12 +179,9 @@ test_expect_success "--recurse-submodules overrides config in submodule" '
 			git config fetch.recurseSubmodules false
 		) &&
 		git fetch --recurse-submodules >../actual.out 2>../actual.err
-	)
-'
-
-test_expect_success C_LOCALE_OUTPUT "--recurse-submodules overrides config in submodule: output" '
-	test_cmp expect.out actual.out &&
-	test_cmp expect.err actual.err
+	) &&
+	test_i18ncmp expect.out actual.out &&
+	test_i18ncmp expect.err actual.err
 '
 
 test_expect_success "--no-recurse-submodules overrides config setting" '
@@ -243,8 +222,8 @@ test_expect_success "Recursion stops when no new submodule commits are fetched"
 		cd downstream &&
 		git fetch >../actual.out 2>../actual.err
 	) &&
-	test_cmp expect.err.sub actual.err &&
-	test_cmp expect.out.sub actual.out
+	test_i18ncmp expect.err.sub actual.err &&
+	test_i18ncmp expect.out.sub actual.out
 '
 
 test_expect_success "Recursion doesn't happen when new superproject commits don't change any submodules" '
@@ -261,7 +240,7 @@ test_expect_success "Recursion doesn't happen when new superproject commits don'
 		git fetch >../actual.out 2>../actual.err
 	) &&
 	! test -s actual.out &&
-	test_cmp expect.err.file actual.err
+	test_i18ncmp expect.err.file actual.err
 '
 
 test_expect_success "Recursion picks up config in submodule" '
@@ -289,8 +268,8 @@ test_expect_success "Recursion picks up config in submodule" '
 			git config --unset fetch.recurseSubmodules
 		)
 	) &&
-	test_cmp expect.err.sub actual.err &&
-	test_cmp expect.out actual.out
+	test_i18ncmp expect.err.sub actual.err &&
+	test_i18ncmp expect.out actual.out
 '
 
 test_expect_success "Recursion picks up all submodules when necessary" '
@@ -321,8 +300,8 @@ test_expect_success "Recursion picks up all submodules when necessary" '
 		cd downstream &&
 		git fetch >../actual.out 2>../actual.err
 	) &&
-	test_cmp expect.err.2 actual.err &&
-	test_cmp expect.out actual.out
+	test_i18ncmp expect.err.2 actual.err &&
+	test_i18ncmp expect.out actual.out
 '
 
 test_expect_success "'--recurse-submodules=on-demand' doesn't recurse when no new commits are fetched in the superproject (and ignores config)" '
@@ -375,8 +354,8 @@ test_expect_success "'--recurse-submodules=on-demand' recurses as deep as necess
 			git config --unset -f .gitmodules submodule.deepsubmodule.fetchRecursive
 		)
 	) &&
-	test_cmp expect.out actual.out &&
-	test_cmp expect.err actual.err
+	test_i18ncmp expect.out actual.out &&
+	test_i18ncmp expect.err actual.err
 '
 
 test_expect_success "'--recurse-submodules=on-demand' stops when no new submodule commits are found in the superproject (and ignores config)" '
@@ -393,7 +372,7 @@ test_expect_success "'--recurse-submodules=on-demand' stops when no new submodul
 		git fetch --recurse-submodules=on-demand >../actual.out 2>../actual.err
 	) &&
 	! test -s actual.out &&
-	test_cmp expect.err.file actual.err
+	test_i18ncmp expect.err.file actual.err
 '
 
 test_expect_success "'fetch.recurseSubmodules=on-demand' overrides global config" '
@@ -420,8 +399,8 @@ test_expect_success "'fetch.recurseSubmodules=on-demand' overrides global config
 		cd downstream &&
 		git config --unset fetch.recurseSubmodules
 	) &&
-	test_cmp expect.out.sub actual.out &&
-	test_cmp expect.err.2 actual.err
+	test_i18ncmp expect.out.sub actual.out &&
+	test_i18ncmp expect.err.2 actual.err
 '
 
 test_expect_success "'submodule.<sub>.fetchRecurseSubmodules=on-demand' overrides fetch.recurseSubmodules" '
@@ -448,8 +427,8 @@ test_expect_success "'submodule.<sub>.fetchRecurseSubmodules=on-demand' override
 		cd downstream &&
 		git config --unset submodule.submodule.fetchRecurseSubmodules
 	) &&
-	test_cmp expect.out.sub actual.out &&
-	test_cmp expect.err.2 actual.err
+	test_i18ncmp expect.out.sub actual.out &&
+	test_i18ncmp expect.err.2 actual.err
 '
 
 test_expect_success "don't fetch submodule when newly recorded commits are already present" '
@@ -468,7 +447,7 @@ test_expect_success "don't fetch submodule when newly recorded commits are alrea
 		git fetch >../actual.out 2>../actual.err
 	) &&
 	! test -s actual.out &&
-	test_cmp expect.err actual.err
+	test_i18ncmp expect.err actual.err
 '
 
 test_done

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

* Re: [PATCH/RFC 7/7] i18n: mark checkout plural warning for translation
  2011-04-12  7:54     ` Ævar Arnfjörð Bjarmason
@ 2011-04-12 20:57       ` Junio C Hamano
  2011-04-13  8:30         ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 21+ messages in thread
From: Junio C Hamano @ 2011-04-12 20:57 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git

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

>>> +             "Warning: you are leaving %d commit behind, "
>>> ...
>>>               "If you want to keep them by creating a new branch, "
>>
>> s/them/it/ as this is a singular case, no?
>
> I just used the message as-is, we were using that for the singular before.

Heh, you cannot claim innocence in this case; it used to be "leaving %d
commit(s) behind, ... if you want _them_", which was consistent with the
earlier use of "commit(s)" ;-).

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

* Re: [PATCH/RFC 1/7] i18n: mark init-db messages for translation
  2011-04-12 18:20         ` Junio C Hamano
@ 2011-04-12 22:55           ` Junio C Hamano
  2011-04-12 23:04             ` Junio C Hamano
  0 siblings, 1 reply; 21+ messages in thread
From: Junio C Hamano @ 2011-04-12 22:55 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git

Junio C Hamano <gitster@pobox.com> writes:

> By the way, don't you think the attached is far easier to read than
> artificially breaking a single test into "do" and "check" phase?  The
> majority of the l10n dependent tests can and should lose C_LOCALE_OUTPUT
> prerequisite and use this instead for far superiour readability, I think.
>
> At least this makes it far more pleasant to read both the actual script
> and the output in non-poison cases.

And this is for the other common pattern: use grep to find expected
string.

 t/test-lib.sh   |    8 ++++++++
 t/t0001-init.sh |   10 +++++-----
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index 3e7c2bb..b764acb 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1085,6 +1085,14 @@ test_i18ncmp () {
 	test -n "$GETTEXT_POISON" || test_cmp "$@"
 }
 
+# Use this instead of "grep expected-string actual" to see if the
+# output from a git command that acn be translated contains an
+# expected string.  When running under GETTEXT_POISON this pretends
+# that the command produced expected results.
+test_i18ngrep () {
+	test -n "$GETTEXT_POISON" || grep "$@"
+}
+
 # test whether the filesystem supports symbolic links
 ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS
 rm -f y
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index a5816d0..651e098 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -180,7 +180,7 @@ test_expect_success 'GIT_DIR & GIT_WORK_TREE (2)' '
 	fi
 '
 
-test_expect_success C_LOCALE_OUTPUT 'reinit' '
+test_expect_success 'reinit' '
 
 	(
 		sane_unset GIT_CONFIG GIT_WORK_TREE GIT_CONFIG &&
@@ -190,11 +190,11 @@ test_expect_success C_LOCALE_OUTPUT 'reinit' '
 		git init >out1 2>err1 &&
 		git init >out2 2>err2
 	) &&
-	grep "Initialized empty" again/out1 &&
-	grep "Reinitialized existing" again/out2 &&
+	test_i18ngrep "Initialized empty" again/out1 &&
+	test_i18ngrep "Reinitialized existing" again/out2 &&
 	>again/empty &&
-	test_cmp again/empty again/err1 &&
-	test_cmp again/empty again/err2
+	test_i18ncmp again/empty again/err1 &&
+	test_i18ncmp again/empty again/err2
 '
 
 test_expect_success 'init with --template' '

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

* Re: [PATCH/RFC 1/7] i18n: mark init-db messages for translation
  2011-04-12 22:55           ` Junio C Hamano
@ 2011-04-12 23:04             ` Junio C Hamano
  2011-04-14 20:56               ` [PATCH] i18n: use test_i18n{grep,cmp} in t7508 Junio C Hamano
  0 siblings, 1 reply; 21+ messages in thread
From: Junio C Hamano @ 2011-04-12 23:04 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git

Junio C Hamano <gitster@pobox.com> writes:

> +# Use this instead of "grep expected-string actual" to see if the
> +# output from a git command that acn be translated contains an
> +# expected string.  When running under GETTEXT_POISON this pretends
> +# that the command produced expected results.
> +test_i18ngrep () {
> +	test -n "$GETTEXT_POISON" || grep "$@"
> +}
> +

I spoke too early.

The common pattern is either to ensure that the actual output has an
expected string, of to ensure that the actual output does not have an
unwanted string.  So this has to be something like:

diff --git a/t/test-lib.sh b/t/test-lib.sh
index 3e7c2bb..874bcc5 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1085,6 +1085,23 @@ test_i18ncmp () {
 	test -n "$GETTEXT_POISON" || test_cmp "$@"
 }
 
+# Use this instead of "grep expected-string actual" to see if the
+# output from a git command that can be translated contains (or does
+# not contain) an expected string.  When running under GETTEXT_POISON
+# this pretends that the command produced expected results.
+test_i18ngrep () {
+	if test -n "$GETTEXT_POISON"
+	then
+	    : # pretend success
+	elif test "x!" = "x$1"
+	then
+	    	shift
+		! grep "$@"
+	else
+	    	grep "$@"
+	fi
+}
+
 # test whether the filesystem supports symbolic links
 ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS
 rm -f y
diff --git a/t/t2019-checkout-ambiguous-ref.sh b/t/t2019-checkout-ambiguous-ref.sh
index cc34e55..30c2225 100755
--- a/t/t2019-checkout-ambiguous-ref.sh
+++ b/t/t2019-checkout-ambiguous-ref.sh
@@ -29,9 +29,9 @@ test_expect_success 'checkout chooses branch over tag' '
 	test_cmp expect file
 '
 
-test_expect_success C_LOCALE_OUTPUT 'checkout reports switch to branch' '
-	grep "Switched to branch" stderr &&
-	! grep "^HEAD is now at" stderr
+test_expect_success 'checkout reports switch to branch' '
+	test_i18ngrep "Switched to branch" stderr &&
+	test_i18ngrep ! "^HEAD is now at" stderr
 '
 
 test_expect_success 'checkout vague ref succeeds' '

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

* Re: [PATCH/RFC 7/7] i18n: mark checkout plural warning for translation
  2011-04-12 20:57       ` Junio C Hamano
@ 2011-04-13  8:30         ` Ævar Arnfjörð Bjarmason
  2011-04-13 15:55           ` Junio C Hamano
  0 siblings, 1 reply; 21+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-04-13  8:30 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Tue, Apr 12, 2011 at 22:57, Junio C Hamano <gitster@pobox.com> wrote:
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>
>>>> +             "Warning: you are leaving %d commit behind, "
>>>> ...
>>>>               "If you want to keep them by creating a new branch, "
>>>
>>> s/them/it/ as this is a singular case, no?
>>
>> I just used the message as-is, we were using that for the singular before.
>
> Heh, you cannot claim innocence in this case; it used to be "leaving %d
> commit(s) behind, ... if you want _them_", which was consistent with the
> earlier use of "commit(s)" ;-).

No, it was:

              "Warning: you are leaving %d commit%s behind, "
               [...]
               lost, ((1 < lost) ? "s" : "")

So it would be "commit" or "commits" depending on the value of the
"lost" variable.

Anyway I could re-submit this or you could fix it up, either is fine by me.

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

* Re: [PATCH/RFC 7/7] i18n: mark checkout plural warning for translation
  2011-04-13  8:30         ` Ævar Arnfjörð Bjarmason
@ 2011-04-13 15:55           ` Junio C Hamano
  0 siblings, 0 replies; 21+ messages in thread
From: Junio C Hamano @ 2011-04-13 15:55 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git

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

> Anyway I could re-submit this or you could fix it up, either is fine by me.

Thanks.  I've queued a fixup together with the test_i18ncmp changes in
'pu'.

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

* [PATCH] i18n: use test_i18n{grep,cmp} in t7508
  2011-04-12 23:04             ` Junio C Hamano
@ 2011-04-14 20:56               ` Junio C Hamano
  0 siblings, 0 replies; 21+ messages in thread
From: Junio C Hamano @ 2011-04-14 20:56 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git

Two tests looked for "[Uu]sage" in the output, but we cannot expect the
l10n to use that phrase.  Mark them with test_i18ngrep so that in later
versions we can test truly localized versions with the same tests, not
just GETTEXT_POISON that happens to keep the original string in the
output.

Merge a few tests that were artificially split into "do" and "test output
under C_LOCALE_OUTPUT" in the original i18n patches back.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---

 * I've queued many others in 'pu' without sending them on the list, but
   this one is a bit different and can use extra sets of eyeballs, so...

 t/t7508-status.sh |  222 ++++++++++++++++++++++++-----------------------------
 1 files changed, 102 insertions(+), 120 deletions(-)

diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index a93e70f..cd6e2c5 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -16,7 +16,7 @@ test_expect_success 'status -h in broken repository' '
 		echo "[status] showuntrackedfiles = CORRUPT" >>.git/config &&
 		test_expect_code 129 git status -h >usage 2>&1
 	) &&
-	grep "[Uu]sage" broken/usage
+	test_i18ngrep "[Uu]sage" broken/usage
 '
 
 test_expect_success 'commit -h in broken repository' '
@@ -28,7 +28,7 @@ test_expect_success 'commit -h in broken repository' '
 		echo "[status] showuntrackedfiles = CORRUPT" >>.git/config &&
 		test_expect_code 129 git commit -h >usage 2>&1
 	) &&
-	grep "[Uu]sage" broken/usage
+	test_i18ngrep "[Uu]sage" broken/usage
 '
 
 test_expect_success 'setup' '
@@ -55,10 +55,8 @@ test_expect_success 'setup' '
 	git add dir2/added
 '
 
-test_expect_success C_LOCALE_OUTPUT 'status (1)' '
-
-	grep "use \"git rm --cached <file>\.\.\.\" to unstage" output
-
+test_expect_success 'status (1)' '
+	test_i18ngrep "use \"git rm --cached <file>\.\.\.\" to unstage" output
 '
 
 cat >expect <<\EOF
@@ -85,11 +83,9 @@ cat >expect <<\EOF
 #	untracked
 EOF
 
-test_expect_success C_LOCALE_OUTPUT 'status (2)' '
-
+test_expect_success 'status (2)' '
 	git status >output &&
-	test_cmp expect output
-
+	test_i18ncmp expect output
 '
 
 cat >expect <<\EOF
@@ -109,17 +105,14 @@ cat >expect <<\EOF
 #	untracked
 EOF
 
-git config advice.statusHints false
-
-test_expect_success C_LOCALE_OUTPUT 'status (advice.statusHints false)' '
-
+test_expect_success 'status (advice.statusHints false)' '
+	test_when_finished "git config --unset advice.statusHints" &&
+	git config advice.statusHints false &&
 	git status >output &&
-	test_cmp expect output
+	test_i18ncmp expect output
 
 '
 
-git config --unset advice.statusHints
-
 cat >expect <<\EOF
  M dir1/modified
 A  dir2/added
@@ -178,16 +171,16 @@ cat >expect <<EOF
 #
 # Untracked files not listed (use -u option to show untracked files)
 EOF
-test_expect_success C_LOCALE_OUTPUT 'status -uno' '
+test_expect_success 'status -uno' '
 	git status -uno >output &&
-	test_cmp expect output
+	test_i18ncmp expect output
 '
 
-test_expect_success C_LOCALE_OUTPUT 'status (status.showUntrackedFiles no)' '
+test_expect_success 'status (status.showUntrackedFiles no)' '
 	git config status.showuntrackedfiles no
 	test_when_finished "git config --unset status.showuntrackedfiles" &&
 	git status >output &&
-	test_cmp expect output
+	test_i18ncmp expect output
 '
 
 cat >expect <<EOF
@@ -201,9 +194,9 @@ cat >expect <<EOF
 # Untracked files not listed
 EOF
 git config advice.statusHints false
-test_expect_success C_LOCALE_OUTPUT 'status -uno (advice.statusHints false)' '
+test_expect_success 'status -uno (advice.statusHints false)' '
 	git status -uno >output &&
-	test_cmp expect output
+	test_i18ncmp expect output
 '
 git config --unset advice.statusHints
 
@@ -246,16 +239,16 @@ cat >expect <<EOF
 #	output
 #	untracked
 EOF
-test_expect_success C_LOCALE_OUTPUT 'status -unormal' '
+test_expect_success 'status -unormal' '
 	git status -unormal >output &&
-	test_cmp expect output
+	test_i18ncmp expect output
 '
 
-test_expect_success C_LOCALE_OUTPUT 'status (status.showUntrackedFiles normal)' '
+test_expect_success 'status (status.showUntrackedFiles normal)' '
 	git config status.showuntrackedfiles normal
 	test_when_finished "git config --unset status.showuntrackedfiles" &&
 	git status >output &&
-	test_cmp expect output
+	test_i18ncmp expect output
 '
 
 cat >expect <<EOF
@@ -305,15 +298,16 @@ cat >expect <<EOF
 #	output
 #	untracked
 EOF
-test_expect_success C_LOCALE_OUTPUT 'status -uall' '
+test_expect_success 'status -uall' '
 	git status -uall >output &&
-	test_cmp expect output
+	test_i18ncmp expect output
 '
-test_expect_success C_LOCALE_OUTPUT 'status (status.showUntrackedFiles all)' '
+
+test_expect_success 'status (status.showUntrackedFiles all)' '
 	git config status.showuntrackedfiles all
 	test_when_finished "git config --unset status.showuntrackedfiles" &&
 	git status >output &&
-	test_cmp expect output
+	test_i18ncmp expect output
 '
 
 test_expect_success 'teardown dir3' '
@@ -367,11 +361,9 @@ cat >expect <<\EOF
 #	../untracked
 EOF
 
-test_expect_success C_LOCALE_OUTPUT 'status with relative paths' '
-
+test_expect_success 'status with relative paths' '
 	(cd dir1 && git status) >output &&
-	test_cmp expect output
-
+	test_i18ncmp expect output
 '
 
 cat >expect <<\EOF
@@ -440,22 +432,18 @@ cat >expect <<\EOF
 #	<BLUE>untracked<RESET>
 EOF
 
-test_expect_success C_LOCALE_OUTPUT 'status with color.ui' '
-
+test_expect_success 'status with color.ui' '
 	git config color.ui always &&
 	test_when_finished "git config --unset color.ui" &&
 	git status | test_decode_color >output &&
-	test_cmp expect output
-
+	test_i18ncmp expect output
 '
 
-test_expect_success C_LOCALE_OUTPUT 'status with color.status' '
-
+test_expect_success 'status with color.status' '
 	git config color.status always &&
 	test_when_finished "git config --unset color.status" &&
 	git status | test_decode_color >output &&
-	test_cmp expect output
-
+	test_i18ncmp expect output
 '
 
 cat >expect <<\EOF
@@ -570,12 +558,12 @@ cat >expect <<\EOF
 EOF
 
 
-test_expect_success C_LOCALE_OUTPUT 'status without relative paths' '
+test_expect_success 'status without relative paths' '
 
 	git config status.relativePaths false &&
 	test_when_finished "git config --unset status.relativePaths" &&
 	(cd dir1 && git status) >output &&
-	test_cmp expect output
+	test_i18ncmp expect output
 
 '
 
@@ -616,11 +604,8 @@ cat <<EOF >expect
 #	untracked
 EOF
 test_expect_success 'dry-run of partial commit excluding new file in index' '
-	git commit --dry-run dir1/modified >output
-'
-
-test_expect_success C_LOCALE_OUTPUT 'dry-run of partial commit excluding new file in index: output' '
-	test_cmp expect output
+	git commit --dry-run dir1/modified >output &&
+	test_i18ncmp expect output
 '
 
 cat >expect <<EOF
@@ -667,15 +652,15 @@ cat >expect <<EOF
 #	output
 #	untracked
 EOF
-test_expect_success C_LOCALE_OUTPUT 'status submodule summary is disabled by default' '
+test_expect_success 'status submodule summary is disabled by default' '
 	git status >output &&
-	test_cmp expect output
+	test_i18ncmp expect output
 '
 
 # we expect the same as the previous test
-test_expect_success C_LOCALE_OUTPUT 'status --untracked-files=all does not show submodule' '
+test_expect_success 'status --untracked-files=all does not show submodule' '
 	git status --untracked-files=all >output &&
-	test_cmp expect output
+	test_i18ncmp expect output
 '
 
 cat >expect <<EOF
@@ -731,10 +716,10 @@ cat >expect <<EOF
 #	output
 #	untracked
 EOF
-test_expect_success C_LOCALE_OUTPUT 'status submodule summary' '
+test_expect_success 'status submodule summary' '
 	git config status.submodulesummary 10 &&
 	git status >output &&
-	test_cmp expect output
+	test_i18ncmp expect output
 '
 
 cat >expect <<EOF
@@ -773,15 +758,12 @@ cat >expect <<EOF
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
 test_expect_success 'status submodule summary (clean submodule): commit' '
-	git commit -m "commit submodule"
-'
-
-test_expect_success C_LOCALE_OUTPUT 'status submodule summary (clean submodule): output' '
+	git commit -m "commit submodule" &&
 	git config status.submodulesummary 10 &&
 	test_must_fail git commit --dry-run >output &&
-	test_cmp expect output &&
+	test_i18ncmp expect output &&
 	git status >output &&
-	test_cmp expect output
+	test_i18ncmp expect output
 '
 
 cat >expect <<EOF
@@ -827,10 +809,10 @@ cat >expect <<EOF
 #	output
 #	untracked
 EOF
-test_expect_success C_LOCALE_OUTPUT 'commit --dry-run submodule summary (--amend)' '
+test_expect_success 'commit --dry-run submodule summary (--amend)' '
 	git config status.submodulesummary 10 &&
 	git commit --dry-run --amend >output &&
-	test_cmp expect output
+	test_i18ncmp expect output
 '
 
 test_expect_success POSIXPERM,SANITY 'status succeeds in a read-only repository' '
@@ -882,84 +864,84 @@ cat > expect << EOF
 #	untracked
 EOF
 
-test_expect_success C_LOCALE_OUTPUT '--ignore-submodules=untracked suppresses submodules with untracked content' '
-	echo modified > sm/untracked &&
-	git status --ignore-submodules=untracked > output &&
-	test_cmp expect output
+test_expect_success '--ignore-submodules=untracked suppresses submodules with untracked content' '
+	echo modified  sm/untracked &&
+	git status --ignore-submodules=untracked >output &&
+	test_i18ncmp expect output
 '
 
-test_expect_success C_LOCALE_OUTPUT '.gitmodules ignore=untracked suppresses submodules with untracked content' '
+test_expect_success '.gitmodules ignore=untracked suppresses submodules with untracked content' '
 	git config diff.ignoreSubmodules dirty &&
 	git status >output &&
-	test_cmp expect output &&
+	test_i18ncmp expect output &&
 	git config --add -f .gitmodules submodule.subname.ignore untracked &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
-	git status > output &&
-	test_cmp expect output &&
+	git status >output &&
+	test_i18ncmp expect output &&
 	git config -f .gitmodules  --remove-section submodule.subname &&
 	git config --unset diff.ignoreSubmodules
 '
 
-test_expect_success C_LOCALE_OUTPUT '.git/config ignore=untracked suppresses submodules with untracked content' '
+test_expect_success '.git/config ignore=untracked suppresses submodules with untracked content' '
 	git config --add -f .gitmodules submodule.subname.ignore none &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git config --add submodule.subname.ignore untracked &&
 	git config --add submodule.subname.path sm &&
-	git status > output &&
-	test_cmp expect output &&
+	git status >output &&
+	test_i18ncmp expect output &&
 	git config --remove-section submodule.subname &&
 	git config --remove-section -f .gitmodules submodule.subname
 '
 
-test_expect_success C_LOCALE_OUTPUT '--ignore-submodules=dirty suppresses submodules with untracked content' '
-	git status --ignore-submodules=dirty > output &&
-	test_cmp expect output
+test_expect_success '--ignore-submodules=dirty suppresses submodules with untracked content' '
+	git status --ignore-submodules=dirty >output &&
+	test_i18ncmp expect output
 '
 
-test_expect_success C_LOCALE_OUTPUT '.gitmodules ignore=dirty suppresses submodules with untracked content' '
+test_expect_success '.gitmodules ignore=dirty suppresses submodules with untracked content' '
 	git config diff.ignoreSubmodules dirty &&
 	git status >output &&
 	! test -s actual &&
 	git config --add -f .gitmodules submodule.subname.ignore dirty &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
-	git status > output &&
-	test_cmp expect output &&
+	git status >output &&
+	test_i18ncmp expect output &&
 	git config -f .gitmodules  --remove-section submodule.subname &&
 	git config --unset diff.ignoreSubmodules
 '
 
-test_expect_success C_LOCALE_OUTPUT '.git/config ignore=dirty suppresses submodules with untracked content' '
+test_expect_success '.git/config ignore=dirty suppresses submodules with untracked content' '
 	git config --add -f .gitmodules submodule.subname.ignore none &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git config --add submodule.subname.ignore dirty &&
 	git config --add submodule.subname.path sm &&
-	git status > output &&
-	test_cmp expect output &&
+	git status >output &&
+	test_i18ncmp expect output &&
 	git config --remove-section submodule.subname &&
 	git config -f .gitmodules  --remove-section submodule.subname
 '
 
-test_expect_success C_LOCALE_OUTPUT '--ignore-submodules=dirty suppresses submodules with modified content' '
-	echo modified > sm/foo &&
-	git status --ignore-submodules=dirty > output &&
-	test_cmp expect output
+test_expect_success '--ignore-submodules=dirty suppresses submodules with modified content' '
+	echo modified >sm/foo &&
+	git status --ignore-submodules=dirty >output &&
+	test_i18ncmp expect output
 '
 
-test_expect_success C_LOCALE_OUTPUT '.gitmodules ignore=dirty suppresses submodules with modified content' '
+test_expect_success '.gitmodules ignore=dirty suppresses submodules with modified content' '
 	git config --add -f .gitmodules submodule.subname.ignore dirty &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
-	git status > output &&
-	test_cmp expect output &&
+	git status >output &&
+	test_i18ncmp expect output &&
 	git config -f .gitmodules  --remove-section submodule.subname
 '
 
-test_expect_success C_LOCALE_OUTPUT '.git/config ignore=dirty suppresses submodules with modified content' '
+test_expect_success '.git/config ignore=dirty suppresses submodules with modified content' '
 	git config --add -f .gitmodules submodule.subname.ignore none &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git config --add submodule.subname.ignore dirty &&
 	git config --add submodule.subname.path sm &&
-	git status > output &&
-	test_cmp expect output &&
+	git status >output &&
+	test_i18ncmp expect output &&
 	git config --remove-section submodule.subname &&
 	git config -f .gitmodules  --remove-section submodule.subname
 '
@@ -996,26 +978,26 @@ cat > expect << EOF
 #	untracked
 EOF
 
-test_expect_success C_LOCALE_OUTPUT "--ignore-submodules=untracked doesn't suppress submodules with modified content" '
+test_expect_success "--ignore-submodules=untracked doesn't suppress submodules with modified content" '
 	git status --ignore-submodules=untracked > output &&
-	test_cmp expect output
+	test_i18ncmp expect output
 '
 
-test_expect_success C_LOCALE_OUTPUT ".gitmodules ignore=untracked doesn't suppress submodules with modified content" '
+test_expect_success ".gitmodules ignore=untracked doesn't suppress submodules with modified content" '
 	git config --add -f .gitmodules submodule.subname.ignore untracked &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
-	git status > output &&
-	test_cmp expect output &&
+	git status >output &&
+	test_i18ncmp expect output &&
 	git config -f .gitmodules  --remove-section submodule.subname
 '
 
-test_expect_success C_LOCALE_OUTPUT ".git/config ignore=untracked doesn't suppress submodules with modified content" '
+test_expect_success ".git/config ignore=untracked doesn't suppress submodules with modified content" '
 	git config --add -f .gitmodules submodule.subname.ignore none &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git config --add submodule.subname.ignore untracked &&
 	git config --add submodule.subname.path sm &&
-	git status > output &&
-	test_cmp expect output &&
+	git status >output &&
+	test_i18ncmp expect output &&
 	git config --remove-section submodule.subname &&
 	git config -f .gitmodules  --remove-section submodule.subname
 '
@@ -1058,49 +1040,49 @@ cat > expect << EOF
 #	untracked
 EOF
 
-test_expect_success C_LOCALE_OUTPUT "--ignore-submodules=untracked doesn't suppress submodule summary" '
+test_expect_success "--ignore-submodules=untracked doesn't suppress submodule summary" '
 	git status --ignore-submodules=untracked > output &&
-	test_cmp expect output
+	test_i18ncmp expect output
 '
 
-test_expect_success C_LOCALE_OUTPUT ".gitmodules ignore=untracked doesn't suppress submodule summary" '
+test_expect_success ".gitmodules ignore=untracked doesn't suppress submodule summary" '
 	git config --add -f .gitmodules submodule.subname.ignore untracked &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
-	git status > output &&
-	test_cmp expect output &&
+	git status >output &&
+	test_i18ncmp expect output &&
 	git config -f .gitmodules  --remove-section submodule.subname
 '
 
-test_expect_success C_LOCALE_OUTPUT ".git/config ignore=untracked doesn't suppress submodule summary" '
+test_expect_success ".git/config ignore=untracked doesn't suppress submodule summary" '
 	git config --add -f .gitmodules submodule.subname.ignore none &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git config --add submodule.subname.ignore untracked &&
 	git config --add submodule.subname.path sm &&
-	git status > output &&
-	test_cmp expect output &&
+	git status >output &&
+	test_i18ncmp expect output &&
 	git config --remove-section submodule.subname &&
 	git config -f .gitmodules  --remove-section submodule.subname
 '
 
-test_expect_success C_LOCALE_OUTPUT "--ignore-submodules=dirty doesn't suppress submodule summary" '
+test_expect_success "--ignore-submodules=dirty doesn't suppress submodule summary" '
 	git status --ignore-submodules=dirty > output &&
-	test_cmp expect output
+	test_i18ncmp expect output
 '
-test_expect_success C_LOCALE_OUTPUT ".gitmodules ignore=dirty doesn't suppress submodule summary" '
+test_expect_success ".gitmodules ignore=dirty doesn't suppress submodule summary" '
 	git config --add -f .gitmodules submodule.subname.ignore dirty &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
-	git status > output &&
-	test_cmp expect output &&
+	git status >output &&
+	test_i18ncmp expect output &&
 	git config -f .gitmodules  --remove-section submodule.subname
 '
 
-test_expect_success C_LOCALE_OUTPUT ".git/config ignore=dirty doesn't suppress submodule summary" '
+test_expect_success ".git/config ignore=dirty doesn't suppress submodule summary" '
 	git config --add -f .gitmodules submodule.subname.ignore none &&
 	git config --add -f .gitmodules submodule.subname.path sm &&
 	git config --add submodule.subname.ignore dirty &&
 	git config --add submodule.subname.path sm &&
-	git status > output &&
-	test_cmp expect output &&
+	git status >output &&
+	test_i18ncmp expect output &&
 	git config --remove-section submodule.subname &&
 	git config -f .gitmodules  --remove-section submodule.subname
 '
@@ -1126,9 +1108,9 @@ cat > expect << EOF
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
 
-test_expect_success C_LOCALE_OUTPUT "--ignore-submodules=all suppresses submodule summary" '
+test_expect_success "--ignore-submodules=all suppresses submodule summary" '
 	git status --ignore-submodules=all > output &&
-	test_cmp expect output
+	test_i18ncmp expect output
 '
 
 test_expect_failure '.gitmodules ignore=all suppresses submodule summary' '

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

end of thread, other threads:[~2011-04-14 20:56 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-10 19:34 [PATCH/RFC 0/7] i18n: mark missing C messages Ævar Arnfjörð Bjarmason
2011-04-10 19:34 ` [PATCH/RFC 1/7] i18n: mark init-db messages for translation Ævar Arnfjörð Bjarmason
2011-04-12  7:12   ` Junio C Hamano
2011-04-12  7:15     ` Junio C Hamano
2011-04-12  7:44       ` Ævar Arnfjörð Bjarmason
2011-04-12 18:20         ` Junio C Hamano
2011-04-12 22:55           ` Junio C Hamano
2011-04-12 23:04             ` Junio C Hamano
2011-04-14 20:56               ` [PATCH] i18n: use test_i18n{grep,cmp} in t7508 Junio C Hamano
2011-04-10 19:34 ` [PATCH/RFC 2/7] i18n: mark merge "Could not read from" message for translation Ævar Arnfjörð Bjarmason
2011-04-10 19:34 ` [PATCH/RFC 3/7] i18n: mark merge "upstream" messages " Ævar Arnfjörð Bjarmason
2011-04-10 19:34 ` [PATCH/RFC 4/7] i18n: mark merge CHERRY_PICK_HEAD " Ævar Arnfjörð Bjarmason
2011-04-10 19:34 ` [PATCH/RFC 5/7] i18n: mark clone nonexistent repository message " Ævar Arnfjörð Bjarmason
2011-04-10 19:34 ` [PATCH/RFC 6/7] i18n: mark checkout --detach messages " Ævar Arnfjörð Bjarmason
2011-04-10 19:34 ` [PATCH/RFC 7/7] i18n: mark checkout plural warning " Ævar Arnfjörð Bjarmason
2011-04-12  7:19   ` Junio C Hamano
2011-04-12  7:54     ` Ævar Arnfjörð Bjarmason
2011-04-12 20:57       ` Junio C Hamano
2011-04-13  8:30         ` Ævar Arnfjörð Bjarmason
2011-04-13 15:55           ` Junio C Hamano
2011-04-12  7:27 ` [PATCH/RFC 0/7] i18n: mark missing C messages Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).