1 # This shell library is Git's interface to gettext.sh. See po/README
2 # for usage instructions.
4 # Copyright (c) 2010 Ævar Arnfjörð Bjarmason
7 # Export the TEXTDOMAIN* data that we need for Git
10 if test -z "$GIT_TEXTDOMAINDIR"
12 TEXTDOMAINDIR
="@@LOCALEDIR@@"
14 TEXTDOMAINDIR
="$GIT_TEXTDOMAINDIR"
18 # First decide what scheme to use...
19 GIT_INTERNAL_GETTEXT_SH_SCHEME
=fallthrough
20 if test -n "@@USE_GETTEXT_SCHEME@@"
22 GIT_INTERNAL_GETTEXT_SH_SCHEME
="@@USE_GETTEXT_SCHEME@@"
23 elif test -n "$GIT_INTERNAL_GETTEXT_TEST_FALLBACKS"
25 : no probing necessary
26 elif test -n "$GIT_GETTEXT_POISON"
28 GIT_INTERNAL_GETTEXT_SH_SCHEME
=poison
29 elif type gettext.sh
>/dev
/null
2>&1
31 # GNU libintl's gettext.sh
32 GIT_INTERNAL_GETTEXT_SH_SCHEME
=gnu
33 elif test "$(gettext -h 2>&1)" = "-h"
35 # gettext binary exists but no gettext.sh. likely to be a gettext
36 # binary on a Solaris or something that is not GNU libintl and
38 GIT_INTERNAL_GETTEXT_SH_SCHEME
=gettext_without_eval_gettext
40 export GIT_INTERNAL_GETTEXT_SH_SCHEME
42 # ... and then follow that decision.
43 case "$GIT_INTERNAL_GETTEXT_SH_SCHEME" in
45 # Use libintl's gettext.sh, or fall back to English if we can't.
48 gettext_without_eval_gettext
)
49 # Solaris has a gettext(1) but no eval_gettext(1)
52 export PATH $
(git sh-i18n--envsubst
--variables "$1");
53 git sh-i18n--envsubst
"$1"
58 # Emit garbage so that tests that incorrectly rely on translatable
61 printf "%s" "# GETTEXT POISON #"
65 printf "%s" "# GETTEXT POISON #"
75 export PATH $
(git sh-i18n--envsubst
--variables "$1");
76 git sh-i18n--envsubst
"$1"
82 # Git-specific wrapper functions