Subject: Re: [PATCH] i18n: disable i18n for shell scripts if NO_GETTEXT defined

From: Jonathan Nieder <[email-masked]>
Date: Wed, 18 Jan 2012 18:12:25 -0600

Hi,

Alex Riesen wrote:

> [Subject: i18n: disable i18n for shell scripts if NO_GETTEXT define]
>
> Otherwise the i18n is used in the scripts even with NO_GETTEXT set.
> It is very unexpected.

Sounds like a good idea.  Quick comments:

[...]
> --- a/git-sh-i18n.sh
> +++ b/git-sh-i18n.sh
> @@ -16,61 +16,44 @@ else
>  fi
>  export TEXTDOMAINDIR
>  
> -if test -z "$GIT_GETTEXT_POISON"
> +GIT_INTERNAL_GETTEXT_SH_SCHEME=fallthrough
> +if test -n "@@NO_GETTEXT@@$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS"
> +then
> +	: no probing necessary
> +elif test -n "$GIT_GETTEXT_POISON"
>  then
> -	if test -z "$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS" && type gettext.sh >/dev/null 2>&1
> -	then
> +elif test -n type gettext.sh >/dev/null 2>&1
> +then

I like the unindenting.  Alas, I get

	1: test: type: unexpected operator

I suspect this should just say "elif type gettext.sh >/dev/null 2>&1".

The rest looks good.  Thanks for writing it.