From 189627cd588c2937de7b655595b8ed777f445c85 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Mon, 5 Nov 2012 06:33:55 -0800 Subject: Imported Upstream version 1.7.10.4 --- t/lib-gettext.sh | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 t/lib-gettext.sh (limited to 't/lib-gettext.sh') diff --git a/t/lib-gettext.sh b/t/lib-gettext.sh new file mode 100644 index 00000000..0f76f6cd --- /dev/null +++ b/t/lib-gettext.sh @@ -0,0 +1,55 @@ +#!/bin/sh +# +# Copyright (c) 2010 Ævar Arnfjörð Bjarmason +# + +. ./test-lib.sh + +GIT_TEXTDOMAINDIR="$GIT_BUILD_DIR/po/build/locale" +GIT_PO_PATH="$GIT_BUILD_DIR/po" +export GIT_TEXTDOMAINDIR GIT_PO_PATH + +. "$GIT_BUILD_DIR"/git-sh-i18n + +if test_have_prereq GETTEXT && ! test_have_prereq GETTEXT_POISON +then + # is_IS.UTF-8 on Solaris and FreeBSD, is_IS.utf8 on Debian + is_IS_locale=$(locale -a | sed -n '/^is_IS\.[uU][tT][fF]-*8$/{ + p + q + }') + # is_IS.ISO8859-1 on Solaris and FreeBSD, is_IS.iso88591 on Debian + is_IS_iso_locale=$(locale -a | sed -n '/^is_IS\.[iI][sS][oO]8859-*1$/{ + p + q + }') + + # Export them as an environment variable so the t0202/test.pl Perl + # test can use it too + export is_IS_locale is_IS_iso_locale + + if test -n "$is_IS_locale" && + test $GIT_INTERNAL_GETTEXT_SH_SCHEME != "fallthrough" + then + # Some of the tests need the reference Icelandic locale + test_set_prereq GETTEXT_LOCALE + + # Exporting for t0202/test.pl + GETTEXT_LOCALE=1 + export GETTEXT_LOCALE + say "# lib-gettext: Found '$is_IS_locale' as an is_IS UTF-8 locale" + else + say "# lib-gettext: No is_IS UTF-8 locale available" + fi + + if test -n "$is_IS_iso_locale" && + test $GIT_INTERNAL_GETTEXT_SH_SCHEME != "fallthrough" + then + # Some of the tests need the reference Icelandic locale + test_set_prereq GETTEXT_ISO_LOCALE + + say "# lib-gettext: Found '$is_IS_iso_locale' as an is_IS ISO-8859-1 locale" + else + say "# lib-gettext: No is_IS ISO-8859-1 locale available" + fi +fi -- cgit v1.2.3