t / lib-gettext.shon commit git p4 test: should honor symlink in p4 client root (89773db)
   1#!/bin/sh
   2#
   3# Copyright (c) 2010 Ævar Arnfjörð Bjarmason
   4#
   5
   6. ./test-lib.sh
   7
   8GIT_TEXTDOMAINDIR="$GIT_BUILD_DIR/po/build/locale"
   9GIT_PO_PATH="$GIT_BUILD_DIR/po"
  10export GIT_TEXTDOMAINDIR GIT_PO_PATH
  11
  12. "$GIT_BUILD_DIR"/git-sh-i18n
  13
  14if test_have_prereq GETTEXT && ! test_have_prereq GETTEXT_POISON
  15then
  16        # is_IS.UTF-8 on Solaris and FreeBSD, is_IS.utf8 on Debian
  17        is_IS_locale=$(locale -a 2>/dev/null |
  18                sed -n '/^is_IS\.[uU][tT][fF]-*8$/{
  19                p
  20                q
  21        }')
  22        # is_IS.ISO8859-1 on Solaris and FreeBSD, is_IS.iso88591 on Debian
  23        is_IS_iso_locale=$(locale -a 2>/dev/null |
  24                sed -n '/^is_IS\.[iI][sS][oO]8859-*1$/{
  25                p
  26                q
  27        }')
  28
  29        # Export them as an environment variable so the t0202/test.pl Perl
  30        # test can use it too
  31        export is_IS_locale is_IS_iso_locale
  32
  33        if test -n "$is_IS_locale" &&
  34                test $GIT_INTERNAL_GETTEXT_SH_SCHEME != "fallthrough"
  35        then
  36                # Some of the tests need the reference Icelandic locale
  37                test_set_prereq GETTEXT_LOCALE
  38
  39                # Exporting for t0202/test.pl
  40                GETTEXT_LOCALE=1
  41                export GETTEXT_LOCALE
  42                say "# lib-gettext: Found '$is_IS_locale' as an is_IS UTF-8 locale"
  43        else
  44                say "# lib-gettext: No is_IS UTF-8 locale available"
  45        fi
  46
  47        if test -n "$is_IS_iso_locale" &&
  48                test $GIT_INTERNAL_GETTEXT_SH_SCHEME != "fallthrough"
  49        then
  50                # Some of the tests need the reference Icelandic locale
  51                test_set_prereq GETTEXT_ISO_LOCALE
  52
  53                say "# lib-gettext: Found '$is_IS_iso_locale' as an is_IS ISO-8859-1 locale"
  54        else
  55                say "# lib-gettext: No is_IS ISO-8859-1 locale available"
  56        fi
  57fi