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

[PATCH 3/7] i18n: Rewrite gettext messages start with dash

From
Jiang Xin <worldhello.net@gmail.com>
Date
Jul 21, 2012, 15:50 UTC
Message-ID
<77cbbce0450735a66ef1d9101af0bc82e3fc545c.1342884459.git.worldhello.net@gmail.com>
In-Reply-To
<0fd901035a418562d3d9282553a96124814a298a.1342884459.git.worldhello.net@gmail.com>

Gettext message in a shell script should not start with '-', one workaround is adding '--' between gettext and the message, like:

    gettext -- "--exec option ..."

But due to a bug in the xgettext extraction, xgettext can not extract the actual message for this case. Rewrite the message is a simpler and better solution.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 git-rebase.sh                 | 2 +-
 git-submodule.sh              | 2 +-
 t/t3404-rebase-interactive.sh | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/git-rebase.sh b/git-rebase.sh
index df5998..640af 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -317,7 +317,7 @@ test $# -gt 2 && usage
 if test -n "$cmd" &&
    test "$interactive_rebase" != explicit
 then
-	die "$(gettext -- "--exec option must be used with --interactive option")"
+	die "$(gettext "The --exec option must be used with the --interactive option")"
 fi
 
 if test -n "$action"
diff --git a/git-submodule.sh b/git-submodule.sh
index 5629d..57f98 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -746,7 +746,7 @@ cmd_summary() {
 	if [ -n "$files" ]
 	then
 		test -n "$cached" &&
-		die "$(gettext -- "--cached cannot be used with --files")"
+		die "$(gettext "The --cached option cannot be used with the --files option")"
 		diff_cmd=diff-files
 		head=
 	fi
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 8078..f206a 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -858,7 +858,7 @@ test_expect_success 'rebase -ix with --autosquash' '
 test_expect_success 'rebase --exec without -i shows error message' '
 	git reset --hard execute &&
 	test_must_fail git rebase --exec "git show HEAD" HEAD~2 2>actual &&
-	echo "--exec option must be used with --interactive option" >expected &&
+	echo "The --exec option must be used with the --interactive option" >expected &&
 	test_i18ncmp expected actual
 '
 
-- 
1.7.11.2.259.g37fc0e1
Previous: Jiang XinNext: Jiang Xin
Message 4 of 14 in “i18n for git-am, git-rebase and git-merge”
  1. 0/7 i18n for git-am, git-rebase and git-mergeJiang Xin, Jul 21, 2012
  2. 1/7 i18n: New keywords for xgettext extraction from shJiang Xin, Jul 21, 2012
  3. 2/7 i18n: rebase: mark strings for translationJiang Xin, Jul 21, 2012
  4. 3/7 i18n: Rewrite gettext messages start with dashJiang Xin, Jul 21, 2012
  5. 4/7 Remove obsolete LONG_USAGE which breaks xgettextJiang Xin, Jul 21, 2012
  6. 5/7 i18n: am: mark more strings for translationJiang Xin, Jul 21, 2012
  7. 6/7 Remove unused and bad gettext block from git-amJiang Xin, Jul 21, 2012
  8. 7/7 i18n: merge-recursive: mark strings for translationJiang Xin, Jul 21, 2012
  9. Stefano LattariniJul 21, 2012
  10. Jiang XinJul 22, 2012
  11. Stefano LattariniJul 21, 2012
  12. Stefano LattariniJul 21, 2012
  13. Stefano LattariniJul 21, 2012
  14. Stefano LattariniJul 21, 2012

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.