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