From 4a2790364aa895c0c9e195ec4dd212cbf4124a14 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 7 Sep 2010 14:55:56 +0000 Subject: [PATCH] gettextize: git-am core say messages MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- git-am.sh | 6 +++--- t/t4150-am.sh | 5 ++++- t/t4151-am-abort.sh | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/git-am.sh b/git-am.sh index fcce1385e..ba8c24e61 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 1c3d8ed54..373d79b46 100755 --- a/t/t4150-am.sh +++ b/t/t4150-am.sh @@ -464,7 +464,10 @@ test_expect_success 'am newline in subject' ' git checkout first && test_tick && sed -e "s/second/second \\\n foo/" patch1 >patchnl && - git am output.out 2>&1 && + git am 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 b55c41178..5bb24f89e 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 && -- 2.30.2