Code

gettextize: git-stash "unknown option" message
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 14 Sep 2010 11:42:21 +0000 (11:42 +0000)
committerÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Sat, 30 Oct 2010 07:58:25 +0000 (07:58 +0000)
Gettextize the "unknown option for 'stash save'" message that's shown
on:

    $ git stash save --blah-blah
    error: unknown option for 'stash save': --blah-blah
           To provide a message, use git stash save -- '--blah-blah'
    Usage: git stash list [<options>]

In a translation the second line should be aligned with the first
one. I've added a TRANSLATORS comment to indicate this.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
git-stash.sh

index e9365d7bf93d5c07fb32589b9f20cf45ad441c47..722669a7d530810cbc6bccadd6df16a417aa0dcc 100755 (executable)
@@ -151,8 +151,14 @@ save_stash () {
                        break
                        ;;
                -*)
-                       echo "error: unknown option for 'stash save': $1"
-                       echo "       To provide a message, use git stash save -- '$1'"
+                       option="$1"
+                       # TRANSLATORS: $option is an invalid option, like
+                       # `--blah-blah'. The 7 spaces at the beginning of the
+                       # second line correspond to "error: ". So you should line
+                       # up the second line with however many characters the
+                       # translation of "error: " takes in your language.
+                       eval_gettext "$("error: unknown option for 'stash save': \$option
+       To provide a message, use git stash save -- '\$option'")"; echo
                        usage
                        ;;
                *)