-# Time-stamp: "2004-06-20 21:48:03 ADT"
+# Time-stamp: "2004-10-06 23:26:33 ADT"
# Sean M. Burke <sburke@cpan.org>
require 5.000;
);
%EXPORT_TAGS = ('ALL' => \@EXPORT_OK);
-$VERSION = "0.32";
+$VERSION = "0.35";
sub uniq { my %seen; return grep(!($seen{$_}++), @_); } # a util function
return $lang if &is_language_tag($lang); # like "en"
$lang =~ tr<_><->; # "en_US" -> en-US
- $lang =~ s<\.[-_a-zA-Z0-9\.]*><>s; # "en_US.ISO8859-1" -> en-US
+ $lang =~ s<(?:[\.\@][-_a-zA-Z0-9]+)+$><>s; # "en_US.ISO8859-1" -> en-US
+ # it_IT.utf8@euro => it-IT
return $lang if &is_language_tag($lang);
You could instead do lookups on $wanted with:
use I18N::LangTags qw(same_language_tag);
- my $repsonse = '';
+ my $response = '';
foreach my $l2 (keys %greetings) {
if(same_language_tag($wanted, $l2)) {
$response = $greetings{$l2};
=head1 COPYRIGHT
-Copyright (c) 1998-2004 Sean M. Burke. All rights reserved.
+Copyright (c) 1998+ Sean M. Burke. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.