3 # Copyright (c) 2010 Ævar Arnfjörð Bjarmason
5 # This is Git's interface to gettext.sh. See po/README for usage
8 # Export the TEXTDOMAIN* data that we need for Git
11 if test -z "$GIT_TEXTDOMAINDIR"
13 TEXTDOMAINDIR
="@@LOCALEDIR@@"
15 TEXTDOMAINDIR
="$GIT_TEXTDOMAINDIR"
19 if test -z "$GIT_GETTEXT_POISON"
21 if test -z "$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS" && type gettext.sh
>/dev
/null
2>&1
23 # This is GNU libintl's gettext.sh, we don't need to do anything
24 # else than setting up the environment and loading gettext.sh
25 GIT_INTERNAL_GETTEXT_SH_SCHEME
=gnu
26 export GIT_INTERNAL_GETTEXT_SH_SCHEME
28 # Try to use libintl's gettext.sh, or fall back to English if we
32 elif test -z "$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS" && test "$(gettext -h 2>&1)" = "-h"
34 # We don't have gettext.sh, but there's a gettext binary in our
35 # path. This is probably Solaris or something like it which has a
36 # gettext implementation that isn't GNU libintl.
37 GIT_INTERNAL_GETTEXT_SH_SCHEME
=solaris
38 export GIT_INTERNAL_GETTEXT_SH_SCHEME
40 # Solaris has a gettext(1) but no eval_gettext(1)
43 export PATH $
(git sh-i18n--envsubst
--variables "$1");
44 git sh-i18n--envsubst
"$1"
49 # Since gettext.sh isn't available we'll have to define our own
50 # dummy pass-through functions.
52 # Tell our tests that we don't have the real gettext.sh
53 GIT_INTERNAL_GETTEXT_SH_SCHEME
=fallthrough
54 export GIT_INTERNAL_GETTEXT_SH_SCHEME
62 export PATH $
(git sh-i18n--envsubst
--variables "$1");
63 git sh-i18n--envsubst
"$1"
68 # Emit garbage under GETTEXT_POISON=YesPlease. Unlike the C tests
69 # this relies on an environment variable
71 GIT_INTERNAL_GETTEXT_SH_SCHEME
=poison
72 export GIT_INTERNAL_GETTEXT_SH_SCHEME
75 printf "%s" "# GETTEXT POISON #"
79 printf "%s" "# GETTEXT POISON #"
83 # Git-specific wrapper functions