From 3c427f16b78f928f0f0a0f6ccd44568d823efd64 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Mon, 30 Aug 2010 15:18:15 +0000 Subject: [PATCH] gettext tests: add detection for is_IS.ISO-8859-1 locale MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- t/lib-gettext.sh | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) 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 -- 2.30.2