Thread (25 messages) flat view 25 messages, 2 authors, 2016-06-15
DORMANTno replies

Revision v1 of 2 in this series.

Revisions (2)
  1. v1 current
  2. v1 [diff vs current]

[PATCH 19/20] gettextize: git-am core say messages

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:49:30
Subsystem: the rest · Maintainer: Linus Torvalds

Make the core git-am messages that use say() translatable. These are
visible on almost every git am invocation.

There are tests that depend on the "Applying" output that need to be
skipped along with this translation.

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 git-am.sh           |    6 +++---
 t/t4150-am.sh       |    4 +++-
 t/t4151-am-abort.sh |    2 +-
 3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/git-am.sh b/git-am.sh
index 90f2a9d..6992d92 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -723,7 +723,7 @@ To restore the original branch and stop patching run \"\$cmdline --abort\"."; ec
 		stop_here $this
 	fi
 
-	say "Applying: $FIRSTLINE"
+	say "$(eval_gettext "Applying: \$FIRSTLINE")"
 
 	case "$resolved" in
 	'')
@@ -768,7 +768,7 @@ did you forget to use 'git add'?"; echo
 		    # Applying the patch to an earlier tree and merging the
 		    # result may have produced the same tree as ours.
 		    git diff-index --quiet --cached HEAD -- && {
-			say No changes -- Patch already applied.
+			say "$(gettext "No changes -- Patch already applied.")"
 			go_next
 			continue
 		    }
@@ -794,7 +794,7 @@ did you forget to use 'git add'?"; echo
 			GIT_AUTHOR_DATE=
 		fi
 		parent=$(git rev-parse --verify -q HEAD) ||
-		say >&2 "applying to an empty history"
+		say >&2 "$(gettext "applying to an empty history")"
 
 		if test -n "$committer_date_is_author_date"
 		then
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index 1c3d8ed..59ba994 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -464,7 +464,9 @@ test_expect_success 'am newline in subject' '
 	git checkout first &&
 	test_tick &&
 	sed -e "s/second/second \\\n foo/" patch1 >patchnl &&
-	git am <patchnl >output.out 2>&1 &&
+	git am <patchnl >output.out 2>&1'
+
+test_expect_success NO_GETTEXT_POISON 'output: am newline in subject' '
 	grep "^Applying: second \\\n foo$" output.out
 '
 
diff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh
index b55c411..5bb24f8 100755
--- a/t/t4151-am-abort.sh
+++ b/t/t4151-am-abort.sh
@@ -43,7 +43,7 @@ do
 		test_cmp expect actual
 	'
 
-	test_expect_success "am$with3 --skip continue after failed am$with3" '
+	test_expect_success NO_GETTEXT_POISON "am$with3 --skip continue after failed am$with3" '
 		test_must_fail git am$with3 --skip >output &&
 		test "$(grep "^Applying" output)" = "Applying: 6" &&
 		test_cmp file-2-expect file-2 &&
-- 
1.7.2.3.313.gcd15
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help