From: Ævar Arnfjörð Bjarmason Date: Mon, 30 Aug 2010 15:18:15 +0000 (+0000) Subject: gettext tests: add detection for is_IS.ISO-8859-1 locale X-Git-Tag: ko-pu~10^2~141 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3c427f16b78f928f0f0a0f6ccd44568d823efd64;p=git.git gettext tests: add detection for is_IS.ISO-8859-1 locale Add a GETTEXT_ISO_LOCALE prerequisite to lib-gettext.sh, it'll be set if we have an is_IS.ISO-8859-1 locale. This is needed for an upcoming test that checks if our gettext library can recode our UTF-8 po/is.po to is_IS.ISO-8859-1 on request. Signed-off-by: Ævar Arnfjörð Bjarmason --- diff --git a/t/lib-gettext.sh b/t/lib-gettext.sh index ced175c53..c9a079e86 100644 --- a/t/lib-gettext.sh +++ b/t/lib-gettext.sh @@ -18,9 +18,15 @@ then p q }') - # Export it as an environmental variable so the t0202/test.pl Perl - # test can use it too - export is_IS_locale + # 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 environmental 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" @@ -35,6 +41,20 @@ then 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 + + # Exporting for t0202/test.pl + GETTEXT_ISO_LOCALE=1 + export GETTEXT_ISO_LOCALE + say "# lib-gettext: Found '$is_IS_iso_locale' as a is_IS ISO-8859-1 locale" + else + say "# lib-gettext: No is_IS ISO-8859-1 locale available" + fi else # Only run some tests when we don't have gettext support test_set_prereq NO_GETTEXT