git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH/RFC 12/12] gettextize: git-submodule "blob" and "submodule" messages

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Sep 13, 2010, 22:09 UTC
Message-ID
<1284415758-20931-13-git-send-email-avarab@gmail.com>
In-Reply-To
<1284415758-20931-1-git-send-email-avarab@gmail.com>

Gettextize the words "blob" and "submodule", which will be interpolated in a message emitted by git-submodule. This is explicitly tested for so we need to skip some tests with NO_GETTEXT_POISON.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 git-submodule.sh             |    6 ++++--
 t/t7401-submodule-summary.sh |    8 ++++----
 2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/git-submodule.sh b/git-submodule.sh
index edf8774..3de519a 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -674,11 +674,13 @@ cmd_summary() {
 		sha1_abbr_dst=$(echo $sha1_dst | cut -c1-7)
 		if test $status = T
 		then
+			blob="$(gettext "blob")"
+			submodule="$(gettext "submodule")"
 			if test $mod_dst = 160000
 			then
-				echo "* $name $sha1_abbr_src(blob)->$sha1_abbr_dst(submodule)$total_commits:"
+				echo "* $name $sha1_abbr_src($blob)->$sha1_abbr_dst($submodule)$total_commits:"
 			else
-				echo "* $name $sha1_abbr_src(submodule)->$sha1_abbr_dst(blob)$total_commits:"
+				echo "* $name $sha1_abbr_src($submodule)->$sha1_abbr_dst($blob)$total_commits:"
 			fi
 		else
 			echo "* $name $sha1_abbr_src...$sha1_abbr_dst$total_commits:"
diff --git a/t/t7401-submodule-summary.sh b/t/t7401-submodule-summary.sh
index 09ef760..a56787a 100755
--- a/t/t7401-submodule-summary.sh
+++ b/t/t7401-submodule-summary.sh
@@ -120,7 +120,7 @@ git add sm1 &&
 rm -f sm1 &&
 mv sm1-bak sm1
 
-test_expect_success 'typechanged submodule(submodule->blob), --cached' "
+test_expect_success NO_GETTEXT_POISON 'typechanged submodule(submodule->blob), --cached' "
     git submodule summary --cached >actual &&
     cat >expected <<-EOF &&
 * sm1 $head4(submodule)->$head5(blob) (3):
@@ -130,7 +130,7 @@ EOF
     test_cmp actual expected
 "
 
-test_expect_success 'typechanged submodule(submodule->blob), --files' "
+test_expect_success NO_GETTEXT_POISON 'typechanged submodule(submodule->blob), --files' "
     git submodule summary --files >actual &&
     cat >expected <<-EOF &&
 * sm1 $head5(blob)->$head4(submodule) (3):
@@ -142,7 +142,7 @@ EOF
 
 rm -rf sm1 &&
 git checkout-index sm1
-test_expect_success 'typechanged submodule(submodule->blob)' "
+test_expect_success NO_GETTEXT_POISON 'typechanged submodule(submodule->blob)' "
     git submodule summary >actual &&
     cat >expected <<-EOF &&
 * sm1 $head4(submodule)->$head5(blob):
@@ -165,7 +165,7 @@ EOF
 "
 
 commit_file
-test_expect_success 'typechanged submodule(blob->submodule)' "
+test_expect_success NO_GETTEXT_POISON 'typechanged submodule(blob->submodule)' "
     git submodule summary >actual &&
     cat >expected <<-EOF &&
 * sm1 $head5(blob)->$head6(submodule) (2):
-- 
1.7.3.rc1.220.gb4d42
Previous: Ævar Arnfjörð Bjarmason
Message 13 of 13 in “gettextize: git-submodule”
  1. 00/12 gettextize: git-submoduleÆvar Arnfjörð Bjarmason, Sep 13, 2010
  2. 01/12 gettextize: git-submodule add git-sh-i18nÆvar Arnfjörð Bjarmason, Sep 13, 2010
  3. 02/12 gettextize: git-submodule echo + eval_gettext messagesÆvar Arnfjörð Bjarmason, Sep 13, 2010
  4. 03/12 gettextize: git-submodule say + eval_gettext messagesÆvar Arnfjörð Bjarmason, Sep 13, 2010
  5. 04/12 gettextize: git-submodule die + eval_gettext messagesÆvar Arnfjörð Bjarmason, Sep 13, 2010
  6. 05/12 gettextize: git-submodule $update_module say + die messagesÆvar Arnfjörð Bjarmason, Sep 13, 2010
  7. 06/12 gettextize: git-submodule "cached cannot be used" messageÆvar Arnfjörð Bjarmason, Sep 13, 2010
  8. 07/12 gettextize: git-submodule "Submodule change[...]" messagesÆvar Arnfjörð Bjarmason, Sep 13, 2010
  9. 08/12 gettextize: git-submodule $errmsg messagesÆvar Arnfjörð Bjarmason, Sep 13, 2010
  10. 09/12 gettextize: git-submodule "Entering [...]" messageÆvar Arnfjörð Bjarmason, Sep 13, 2010
  11. 10/12 gettextize: git-submodule "[...] path is ignored" messageÆvar Arnfjörð Bjarmason, Sep 13, 2010
  12. 11/12 gettextize: git-submodule "path not initialized" messageÆvar Arnfjörð Bjarmason, Sep 13, 2010
  13. 12/12 gettextize: git-submodule "blob" and "submodule" messagesÆvar Arnfjörð Bjarmason, Sep 13, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.