Thread (5 messages) flat view 5 messages, 3 authors, 2016-06-15

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

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:52:49

Possibly related (same subject, not in this thread)

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:

[...]
quoted hunk ↗ jump to hunk
--- 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help