From: Abhijit Menon-Sen Date: Sat, 24 Jan 2004 08:59:11 +0000 (+0000) Subject: Upgrade to Locale::Maketext 1.08. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cb0af21342720ff0ea17f82801a612db684404a9;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Locale::Maketext 1.08. p4raw-id: //depot/perl@22204 --- diff --git a/MANIFEST b/MANIFEST index b8a5ee7..5df464d 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1334,6 +1334,7 @@ lib/Locale/Maketext/t/02get.t See if Locale::Maketext works lib/Locale/Maketext/t/03http.t See if Locale::Maketext works lib/Locale/Maketext/t/04super.t See if Locale::Maketext works lib/Locale/Maketext/t/05super.t See if Locale::Maketext works +lib/Locale/Maketext/t/06super.t See if Locale::Maketext works lib/Locale/Maketext/t/90utf8.t Locale::Maketext lib/Locale/Maketext/TPJ13.pod Locale::Maketext documentation article lib/locale.pm For "use locale" diff --git a/lib/Locale/Maketext.pm b/lib/Locale/Maketext.pm index 757b817..07b6b19 100644 --- a/lib/Locale/Maketext.pm +++ b/lib/Locale/Maketext.pm @@ -1,5 +1,5 @@ -# Time-stamp: "2004-01-11 19:02:37 AST" +# Time-stamp: "2004-01-19 15:11:14 AST" require 5; package Locale::Maketext; @@ -14,7 +14,7 @@ use I18N::LangTags 0.21 (); BEGIN { unless(defined &DEBUG) { *DEBUG = sub () {0} } } # define the constant 'DEBUG' at compile-time -$VERSION = "1.07"; +$VERSION = "1.08"; @ISA = (); $MATCH_SUPERS = 1; @@ -283,14 +283,14 @@ sub _langtag_munging { @languages; # catch alternation DEBUG and print "Lgs\@", __LINE__, ": ", map("<$_>", @languages), "\n"; + @languages = $base_class->_add_supers( @languages ); + if( defined &I18N::LangTags::panic_languages ) { push @languages, I18N::LangTags::panic_languages(@languages); DEBUG and print "After adding panic languages:\n", " Lgs\@", __LINE__, ": ", map("<$_>", @languages), "\n"; } - @languages = $base_class->_add_supers( @languages ); - push @languages, $base_class->fallback_languages; # You are free to override fallback_languages to return empty-list! DEBUG and print "Lgs\@", __LINE__, ": ", map("<$_>", @languages), "\n"; @@ -559,3 +559,4 @@ you could easily halve or double the amount of cumin, or use chopped mint leaves instead of dill, or lime juice instead of lemon, et cetera. [end] + diff --git a/lib/Locale/Maketext/ChangeLog b/lib/Locale/Maketext/ChangeLog index f19ffc8..96556f4 100644 --- a/lib/Locale/Maketext/ChangeLog +++ b/lib/Locale/Maketext/ChangeLog @@ -1,6 +1,17 @@ Revision history for Perl suite Locale::Maketext - Time-stamp: "2004-01-11 18:30:43 AST" + Time-stamp: "2004-01-19 15:11:56 AST" +2004-01-19 Sean M. Burke sburke@cpan.org + + * Release 1.08: + + * Corrected a one-line code bug in v1.07 that accidentally demoted + all en-* tags in cases of lexicon-groups that had an en.pm but no + en_*.pm. Thanks to Robert Spier for spotting this. Test added. + So don't use v1.07! + + * Autrijus found some typoes in the TPJ article. Fixed.1 + 2004-01-11 Sean M. Burke sburke@cpan.org * Release 1.07: Now uses a new and different rule for implicating diff --git a/lib/Locale/Maketext/TPJ13.pod b/lib/Locale/Maketext/TPJ13.pod index 10f0428..149b84c 100644 --- a/lib/Locale/Maketext/TPJ13.pod +++ b/lib/Locale/Maketext/TPJ13.pod @@ -2,6 +2,8 @@ # This document contains text in Perl "POD" format. # Use a POD viewer like perldoc or perlman to render it. +# This corrects some typoes in the previous release. + =head1 NAME Locale::Maketext::TPJ13 -- article about software localization diff --git a/lib/Locale/Maketext/t/06super.t b/lib/Locale/Maketext/t/06super.t new file mode 100644 index 0000000..922275d --- /dev/null +++ b/lib/Locale/Maketext/t/06super.t @@ -0,0 +1,31 @@ + +require 5; +use strict; +use Test; + +# use a BEGIN block so we print our plan before MyModule is loaded +BEGIN { plan tests => 3 } + +ok 1; +print "# Locale::Maketext version $Locale::Maketext::VERSION\n"; + +#sub Locale::Maketext::DEBUG () {10}; +use Locale::Maketext (); +{ package Whunk::L10N; use vars qw(@ISA %Lexicon); @ISA = 'Locale::Maketext'; + %Lexicon = ("hello" => "SROBLR!"); +} +{ package Whunk::L10N::en; use vars qw(@ISA %Lexicon); @ISA = 'Whunk::L10N'; + %Lexicon = ("hello" => "HI AND STUFF!"); +} +{ package Whunk::L10N::zh_tw; use vars qw(@ISA %Lexicon); @ISA = 'Whunk::L10N'; + %Lexicon = ("hello" => "NIHAU JOE!"); +} + +$ENV{'REQUEST_METHOD'} = 'GET'; +$ENV{'HTTP_ACCEPT_LANGUAGE'} = 'en-US, zh-TW'; + +my $x = Whunk::L10N->get_handle; +print "# LH object: $x\n"; +ok $x->maketext('hello'), "HI AND STUFF!"; +print "# OK bye\n"; +ok 1;