Skip to content

Commit ad17ea7

Browse files
raalkmlgitster
authored andcommitted
add a Makefile switch to avoid gettext translation in shell scripts
Some systems have gettext.sh (GNU gettext) installed, but it is either broken or misconfigured in such a way so its output is not usable. In case the users of these systems are unable or not interested in fixing them, setting the new Makefile switch should help: make USE_GETTEXT_SCHEME=fallthrough This will replace the translation routines with fallthrough versions, that does not use gettext from the platform. Signed-off-by: Alex Riesen <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 42f1611 commit ad17ea7

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ all::
4747
# A translated Git requires GNU libintl or another gettext implementation,
4848
# plus libintl-perl at runtime.
4949
#
50+
# Define USE_GETTEXT_SCHEME and set it to 'fallthrough', if you don't trust
51+
# the installed gettext translation of the shell scripts output.
52+
#
5053
# Define HAVE_LIBCHARSET_H if you haven't set NO_GETTEXT and you can't
5154
# trust the langinfo.h's nl_langinfo(CODESET) function to return the
5255
# current character set. GNU and Solaris have a nl_langinfo(CODESET),
@@ -1874,6 +1877,7 @@ sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
18741877
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
18751878
-e 's|@@LOCALEDIR@@|$(localedir_SQ)|g' \
18761879
-e 's/@@NO_CURL@@/$(NO_CURL)/g' \
1880+
-e 's/@@USE_GETTEXT_SCHEME@@/$(USE_GETTEXT_SCHEME)/g' \
18771881
-e $(BROKEN_PATH_FIX) \
18781882
18791883
endef
@@ -2251,7 +2255,7 @@ cscope:
22512255
### Detect prefix changes
22522256
TRACK_CFLAGS = $(CC):$(subst ','\'',$(ALL_CFLAGS)):\
22532257
$(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ):\
2254-
$(localedir_SQ)
2258+
$(localedir_SQ):$(USE_GETTEXT_SCHEME)
22552259

22562260
GIT-CFLAGS: FORCE
22572261
@FLAGS='$(TRACK_CFLAGS)'; \

git-sh-i18n.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ export TEXTDOMAINDIR
1818

1919
# First decide what scheme to use...
2020
GIT_INTERNAL_GETTEXT_SH_SCHEME=fallthrough
21-
if test -n "$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS"
21+
if test -n "@@USE_GETTEXT_SCHEME@@"
22+
then
23+
GIT_INTERNAL_GETTEXT_SH_SCHEME="@@USE_GETTEXT_SCHEME@@"
24+
elif test -n "@@USE_FALLTHROUGH_GETTEXT_SCHEME@@$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS"
2225
then
2326
: no probing necessary
2427
elif test -n "$GIT_GETTEXT_POISON"

0 commit comments

Comments
 (0)