From: Rafael Garcia-Suarez Date: Fri, 2 Jul 2004 07:50:42 +0000 (+0000) Subject: Upgrade to I18N::LangTags 0.33 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=66ee8a1ca11aa02dcc73e69fb12f718ad1e38cc7;p=p5sagit%2Fp5-mst-13.2.git Upgrade to I18N::LangTags 0.33 p4raw-id: //depot/perl@23024 --- diff --git a/lib/I18N/LangTags.pm b/lib/I18N/LangTags.pm index 1054432..e57e076 100644 --- a/lib/I18N/LangTags.pm +++ b/lib/I18N/LangTags.pm @@ -1,5 +1,5 @@ -# Time-stamp: "2004-06-20 21:48:03 ADT" +# Time-stamp: "2004-07-01 14:34:40 ADT" # Sean M. Burke require 5.000; @@ -19,7 +19,7 @@ require Exporter; ); %EXPORT_TAGS = ('ALL' => \@EXPORT_OK); -$VERSION = "0.32"; +$VERSION = "0.33"; sub uniq { my %seen; return grep(!($seen{$_}++), @_); } # a util function diff --git a/lib/I18N/LangTags/ChangeLog b/lib/I18N/LangTags/ChangeLog index 57477cc..403a3cb 100644 --- a/lib/I18N/LangTags/ChangeLog +++ b/lib/I18N/LangTags/ChangeLog @@ -1,6 +1,16 @@ Revision history for Perl module I18N::LangTags. - Time-stamp: "2004-06-20 21:50:16 ADT" + Time-stamp: "2004-07-01 14:28:23 ADT" +2004-07-01 Sean M. Burke sburke@cpan.org + + * Release 0.33 + + Minor bugfix version: + The test 80_all_env.t was erroneously failing for people with + LC_ALL or LC_MESSAGES set. Fixed. Thanks to everyone, especially + Nicholas Clark, who patiently helped out with this. + + 2004-06-20 Sean M. Burke sburke@cpan.org * Release 0.32 diff --git a/lib/I18N/LangTags/t/80_all_env.t b/lib/I18N/LangTags/t/80_all_env.t index 288f735..1362d5e 100644 --- a/lib/I18N/LangTags/t/80_all_env.t +++ b/lib/I18N/LangTags/t/80_all_env.t @@ -1,8 +1,8 @@ require 5; use Test; -# Time-stamp: "2004-06-20 21:51:11 ADT" -BEGIN { plan tests => 14; } +# Time-stamp: "2004-07-01 14:33:50 ADT" +BEGIN { plan tests => 20; } use I18N::LangTags::Detect 1.01; print "# Hi there...\n"; ok 1; @@ -35,22 +35,63 @@ sub printenv { $ENV{'IGNORE_WIN32_LOCALE'} = 1; # a hack, just for testing's sake. + +print "# Test LANGUAGE...\n"; +$ENV{'REQUEST_METHOD'} = ''; +$ENV{'LANGUAGE'} = 'Eu-MT'; +$ENV{'LC_ALL'} = ''; +$ENV{'LC_MESSAGES'} = ''; +$ENV{'LANG'} = ''; +ok show( scalar I18N::LangTags::Detect::detect()), "eu-mt"; +ok show( j I18N::LangTags::Detect::detect()), q{["eu-mt"]}; + + +print "# Test LC_ALL...\n"; +$ENV{'REQUEST_METHOD'} = ''; +$ENV{'LANGUAGE'} = ''; +$ENV{'LC_ALL'} = 'Eu-MT'; +$ENV{'LC_MESSAGES'} = ''; +$ENV{'LANG'} = ''; + +ok show( scalar I18N::LangTags::Detect::detect()), "eu-mt"; +ok show( j I18N::LangTags::Detect::detect()), q{["eu-mt"]}; + +print "# Test LC_MESSAGES...\n"; +$ENV{'REQUEST_METHOD'} = ''; +$ENV{'LANGUAGE'} = ''; +$ENV{'LC_ALL'} = ''; +$ENV{'LC_MESSAGES'} = 'Eu-MT'; +$ENV{'LANG'} = ''; + +ok show( scalar I18N::LangTags::Detect::detect()), "eu-mt"; +ok show( j I18N::LangTags::Detect::detect()), q{["eu-mt"]}; + + print "# Test LANG...\n"; $ENV{'REQUEST_METHOD'} = ''; -$ENV{'LANG'} = 'Eu_MT'; -$ENV{'LC_ALL'} = ''; -$ENV{'LANGUAGE'} = ''; -$ENV{'LC_MESSAGES'} = ''; +$ENV{'LANGUAGE'} = ''; +$ENV{'LC_ALL'} = ''; +$ENV{'LC_MESSAGES'} = ''; +$ENV{'LANG'} = 'Eu_MT'; + ok show( scalar I18N::LangTags::Detect::detect()), "eu-mt"; ok show( j I18N::LangTags::Detect::detect()), q{["eu-mt"]}; -print "# Test LANGUAGE...\n"; -$ENV{'LANG'} = ''; -$ENV{'LANGUAGE'} = 'Eu-MT'; + + +print "# Test LANG...\n"; +$ENV{'LANGUAGE'} = ''; +$ENV{'REQUEST_METHOD'} = ''; +$ENV{'LC_ALL'} = ''; +$ENV{'LC_MESSAGES'} = ''; +$ENV{'LANG'} = 'Eu_MT'; + ok show( scalar I18N::LangTags::Detect::detect()), "eu-mt"; ok show( j I18N::LangTags::Detect::detect()), q{["eu-mt"]}; + + print "# Test HTTP_ACCEPT_LANGUAGE...\n"; $ENV{'REQUEST_METHOD'} = 'GET'; $ENV{'HTTP_ACCEPT_LANGUAGE'} = 'eu-MT';