From: Nicholas Clark Date: Sun, 27 Jun 2004 20:57:50 +0000 (+0000) Subject: Assimilate Locale-Codes-2.07 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=356373a2d8b3989a5bd4c75cba13144296e37c1d;p=p5sagit%2Fp5-mst-13.2.git Assimilate Locale-Codes-2.07 p4raw-id: //depot/perl@23002 --- diff --git a/lib/Locale/Codes/ChangeLog b/lib/Locale/Codes/ChangeLog index 4d8ac19..c724b38 100644 --- a/lib/Locale/Codes/ChangeLog +++ b/lib/Locale/Codes/ChangeLog @@ -1,6 +1,34 @@ ChangeLog for Locale-Codes Distribution +2.07 2004-06-10 neilb + * made $_ local in the initialisation code for each module + change back-propagated from Perl distribution + * removed two non ISO-8859-1 characters from language names + change back-propagated from Perl distribution + * added the following aliases, with a test case for each + - Burma added to Myanmar + - French Southern and Antarctic Lands to + French Southern Territories + patch from TJ Mather + * "Canadian Dollar" was mis-spelled as "Candian Dollar" + - noted by Nick Cabatoff, patch from Michael Hennecke + * Changes to Locale::Country reflecting changes in ISO 3166 + - added Aland Islands (ax, ala, 248) + - YUGOSLAVIA is now SERBIA AND MONTENEGRO + YU => CS + YUG => SCG + 891 => 891 (unchanged) + (YUGOSLAVIA retained as an alias) + - EAST TIMOR changed to TIMOR-LESTE + (old name retained as an alias) + - three letter code for Romania changed from ROM to ROU + * ZAIRE is now CONGO, THE DEMOCRATIC REPUBLIC OF THE + ZR => CD + ZAR => COD + 180 => 180 (unchanged) + (ZAIRE retained as alias) + 2.06 2002-07-15 neilb * The four modules which have data after __DATA__ weren't diff --git a/lib/Locale/Codes/README b/lib/Locale/Codes/README index 8dbba64..9920aba 100644 --- a/lib/Locale/Codes/README +++ b/lib/Locale/Codes/README @@ -1,6 +1,8 @@ Locale-Codes Distribution - v2.06 + v2.07 + +For changes in this release, please see the ChangeLog file. This distribution contains four Perl modules which can be used to process ISO codes for identifying languages, countries, scripts, diff --git a/lib/Locale/Codes/t/all.t b/lib/Locale/Codes/t/all.t index 6c751aa..f70727c 100644 --- a/lib/Locale/Codes/t/all.t +++ b/lib/Locale/Codes/t/all.t @@ -12,11 +12,6 @@ # starting with list of languages/countries/currencies. # -BEGIN { - chdir 't' if -d 't'; - @INC = '../lib'; -} - use Locale::Country; use Locale::Language; use Locale::Currency; diff --git a/lib/Locale/Codes/t/constants.t b/lib/Locale/Codes/t/constants.t index 359cdfc..e71103d 100644 --- a/lib/Locale/Codes/t/constants.t +++ b/lib/Locale/Codes/t/constants.t @@ -3,11 +3,6 @@ # constants.t - tests for Locale::Constants # -BEGIN { - chdir 't' if -d 't'; - @INC = '../lib'; -} - use Locale::Constants; print "1..3\n"; diff --git a/lib/Locale/Codes/t/country.t b/lib/Locale/Codes/t/country.t index 5fa6b6d..0c9fda8 100644 --- a/lib/Locale/Codes/t/country.t +++ b/lib/Locale/Codes/t/country.t @@ -3,11 +3,6 @@ # country.t - tests for Locale::Country # -BEGIN { - chdir 't' if -d 't'; - @INC = '../lib'; -} - use Locale::Country; #----------------------------------------------------------------------- @@ -57,9 +52,9 @@ use Locale::Country; ['country2code("macao") eq "mo"', 0], ['country2code("macau") eq "mo"', 0], - ['code2country("tl", LOCALE_CODE_ALPHA_2) eq "East Timor"', 0], - ['code2country("tls", LOCALE_CODE_ALPHA_3) eq "East Timor"', 0], - ['code2country("626", LOCALE_CODE_NUMERIC) eq "East Timor"', 0], + ['code2country("tl", LOCALE_CODE_ALPHA_2) eq "Timor-Leste"', 0], + ['code2country("tls", LOCALE_CODE_ALPHA_3) eq "Timor-Leste"', 0], + ['code2country("626", LOCALE_CODE_NUMERIC) eq "Timor-Leste"', 0], #================================================ # TESTS FOR country2code @@ -89,7 +84,7 @@ use Locale::Country; ['country2code("Jan Mayen") eq "sj"', 0], # alias ['country2code("USA") eq "us"', 0], # alias ['country2code("United States of America") eq "us"', 0], # alias - ['country2code("Great Britain") eq "gb"', 0], # alias + ['country2code("Great Britain") eq "gb"', 0], # alias #================================================ # TESTS FOR country_code2code @@ -112,6 +107,27 @@ use Locale::Country; ['country_code2code(858, LOCALE_CODE_NUMERIC, LOCALE_CODE_ALPHA_3) eq "ury"', 0], ['country_code2code("tr", LOCALE_CODE_ALPHA_2, LOCALE_CODE_NUMERIC) eq "792"', 0], + #-- tests added for 2.07 release + ['country2code("Burma") eq "mm"', 0], # alias + ['country2code("French Southern and Antarctic Lands") eq "tf"', 0], # alias + ['code2country("ax") eq "Aland Islands"', 0], + ['country2code("Aland Islands") eq "ax"', 0], + ['code2country("ala", LOCALE_CODE_ALPHA_3) eq "Aland Islands"', 0], + ['code2country("248", LOCALE_CODE_NUMERIC) eq "Aland Islands"', 0], + + ['country2code("Yugoslavia") eq "cs"', 0], # alias (old name) + ['country2code("Serbia and Montenegro") eq "cs"', 0], # new name + ['code2country("scg", LOCALE_CODE_ALPHA_3) eq "Serbia and Montenegro"', 0], + ['code2country("891", LOCALE_CODE_NUMERIC) eq "Serbia and Montenegro"', 0], + + ['country2code("East Timor") eq "tl"', 0], # alias (provisional name) + ['code2country("rou", LOCALE_CODE_ALPHA_3) eq "Romania"', 0], + + ['country2code("Zaire") eq "cd"', 0], # alias (old name) + ['country2code("Congo, The Democratic Republic of the") eq "cd"', 0], # new name + ['country2code("Congo, The Democratic Republic of the", LOCALE_CODE_ALPHA_3) eq "cod"', 0], # new name + ['country2code("Congo, The Democratic Republic of the", LOCALE_CODE_NUMERIC) eq "180"', 0], # new name + ); print "1..", int(@TESTS), "\n"; diff --git a/lib/Locale/Codes/t/currency.t b/lib/Locale/Codes/t/currency.t index 55a04db..adb844e 100644 --- a/lib/Locale/Codes/t/currency.t +++ b/lib/Locale/Codes/t/currency.t @@ -2,12 +2,6 @@ # # currency.t - tests for Locale::Currency # - -BEGIN { - chdir 't' if -d 't'; - @INC = '../lib'; -} - use Locale::Currency; #----------------------------------------------------------------------- @@ -70,6 +64,7 @@ use Locale::Currency; 'currency2code("PULA") eq "bwp"', 'currency2code("Andorran Peseta") eq "adp"', # first in DATA segment 'currency2code("Zimbabwe Dollar") eq "zwd"', # last in DATA segment + 'currency2code("Canadian Dollar") eq "cad"', # last in DATA segment ); print "1..", int(@TESTS), "\n"; diff --git a/lib/Locale/Codes/t/uk.t b/lib/Locale/Codes/t/uk.t index ceca372..95c2118 100644 --- a/lib/Locale/Codes/t/uk.t +++ b/lib/Locale/Codes/t/uk.t @@ -3,11 +3,6 @@ # uk.t - tests for Locale::Country with "uk" aliases to "gb" # -BEGIN { - chdir 't' if -d 't'; - @INC = '../lib'; -} - use Locale::Country; Locale::Country::alias_code('uk' => 'gb'); diff --git a/lib/Locale/Constants.pm b/lib/Locale/Constants.pm index c16d45e..d8ef8f7 100644 --- a/lib/Locale/Constants.pm +++ b/lib/Locale/Constants.pm @@ -1,7 +1,7 @@ # # Locale::Constants - defined constants for identifying codesets # -# $Id: Constants.pm,v 2.1 2002/02/06 04:07:09 neilb Exp $ +# $Id: Constants.pm,v 2.7 2004/06/10 21:19:34 neilb Exp $ # package Locale::Constants; @@ -13,7 +13,7 @@ require Exporter; # Public Global Variables #----------------------------------------------------------------------- use vars qw($VERSION @ISA @EXPORT); -$VERSION = sprintf("%d.%02d", q$Revision: 2.1 $ =~ /(\d+)\.(\d+)/); +$VERSION = sprintf("%d.%02d", q$Revision: 2.7 $ =~ /(\d+)\.(\d+)/); @ISA = qw(Exporter); @EXPORT = qw(LOCALE_CODE_ALPHA_2 LOCALE_CODE_ALPHA_3 LOCALE_CODE_NUMERIC LOCALE_CODE_DEFAULT); diff --git a/lib/Locale/Constants.pod b/lib/Locale/Constants.pod index 68d3358..ae42abb 100644 --- a/lib/Locale/Constants.pod +++ b/lib/Locale/Constants.pod @@ -65,7 +65,7 @@ Neil Bowers Eneil@bowers.comE =head1 COPYRIGHT -Copyright (C) 2002, Neil Bowers. +Copyright (C) 2002-2004, Neil Bowers. Copyright (C) 2001, Canon Research Centre Europe (CRE). diff --git a/lib/Locale/Country.pm b/lib/Locale/Country.pm index eab7249..2ecd130 100644 --- a/lib/Locale/Country.pm +++ b/lib/Locale/Country.pm @@ -1,7 +1,7 @@ # # Locale::Country - ISO codes for country identification (ISO 3166) # -# $Id: Country.pm,v 2.6 2002/07/10 16:33:27 neilb Exp $ +# $Id: Country.pm,v 2.7 2004/06/10 21:19:34 neilb Exp $ # package Locale::Country; @@ -17,7 +17,7 @@ use Locale::Constants; # Public Global Variables #----------------------------------------------------------------------- use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); -$VERSION = sprintf("%d.%02d", q$Revision: 2.61 $ =~ /(\d+)\.(\d+)/); +$VERSION = sprintf("%d.%02d", q$Revision: 2.7 $ =~ /(\d+)\.(\d+)/); @ISA = qw(Exporter); @EXPORT = qw(code2country country2code all_country_codes all_country_names @@ -264,11 +264,11 @@ sub _code2codeset # #======================================================================= { - my ($alpha2, $alpha3, $numeric); - my ($country, @countries); - + my ($alpha2, $alpha3, $numeric); + my ($country, @countries); local $_; + while () { next unless /\S/; @@ -322,6 +322,7 @@ as:asm:016:American Samoa at:aut:040:Austria au:aus:036:Australia aw:abw:533:Aruba +ax:ala:248:Aland Islands az:aze:031:Azerbaijan ba:bih:070:Bosnia and Herzegovina bb:brb:052:Barbados @@ -344,6 +345,7 @@ by:blr:112:Belarus bz:blz:084:Belize ca:can:124:Canada cc:cck:166:Cocos (Keeling) Islands +cd:cod:180:Congo, The Democratic Republic of the:Zaire:Congo, Democratic Republic of the cf:caf:140:Central African Republic cg:cog:178:Congo:Congo, Republic of the ch:che:756:Switzerland @@ -354,6 +356,7 @@ cm:cmr:120:Cameroon cn:chn:156:China co:col:170:Colombia cr:cri:188:Costa Rica +cs:scg:891:Serbia and Montenegro:Yugoslavia cu:cub:192:Cuba cv:cpv:132:Cape Verde cx:cxr:162:Christmas Island @@ -444,7 +447,7 @@ mg:mdg:450:Madagascar mh:mhl:584:Marshall Islands mk:mkd:807:Macedonia, the Former Yugoslav Republic of:Macedonia, Former Yugoslav Republic of:Macedonia ml:mli:466:Mali -mm:mmr:104:Myanmar +mm:mmr:104:Myanmar:Burma mn:mng:496:Mongolia mo:mac:446:Macao:Macau mp:mnp:580:Northern Mariana Islands @@ -487,7 +490,7 @@ pw:plw:585:Palau py:pry:600:Paraguay qa:qat:634:Qatar re:reu:638:Reunion -ro:rom:642:Romania +ro:rou:642:Romania ru:rus:643:Russian Federation:Russia rw:rwa:646:Rwanda sa:sau:682:Saudi Arabia @@ -511,7 +514,7 @@ sy:syr:760:Syrian Arab Republic:Syria sz:swz:748:Swaziland tc:tca:796:Turks and Caicos Islands td:tcd:148:Chad -tf:atf:260:French Southern Territories +tf:atf:260:French Southern Territories:French Southern and Antarctic Lands tg:tgo:768:Togo th:tha:764:Thailand tj:tjk:762:Tajikistan @@ -519,7 +522,7 @@ tk:tkl:772:Tokelau tm:tkm:795:Turkmenistan tn:tun:788:Tunisia to:ton:776:Tonga -tl:tls:626:East Timor +tl:tls:626:Timor-Leste:East Timor tr:tur:792:Turkey tt:tto:780:Trinidad and Tobago tv:tuv:798:Tuvalu @@ -542,8 +545,6 @@ wf:wlf:876:Wallis and Futuna ws:wsm:882:Samoa ye:yem:887:Yemen yt:myt:175:Mayotte -yu:yug:891:Yugoslavia za:zaf:710:South Africa zm:zmb:894:Zambia -zr:zar:180:Zaire:Congo, The Democratic Republic of the:Congo, Democratic Republic of the zw:zwe:716:Zimbabwe diff --git a/lib/Locale/Country.pod b/lib/Locale/Country.pod index 3716eac..b13cd22 100644 --- a/lib/Locale/Country.pod +++ b/lib/Locale/Country.pod @@ -295,7 +295,7 @@ Neil Bowers Eneil@bowers.comE =head1 COPYRIGHT -Copyright (C) 2002, Neil Bowers. +Copyright (C) 2002-2004, Neil Bowers. Copyright (c) 1997-2001 Canon Research Centre Europe (CRE). diff --git a/lib/Locale/Currency.pm b/lib/Locale/Currency.pm index 8a94838..13cd048 100644 --- a/lib/Locale/Currency.pm +++ b/lib/Locale/Currency.pm @@ -2,7 +2,7 @@ # Locale::Currency - ISO three letter codes for currency identification # (ISO 4217) # -# $Id: Currency.pm,v 2.2 2002/07/10 16:33:27 neilb Exp $ +# $Id: Currency.pm,v 2.7 2004/06/10 21:19:34 neilb Exp $ # package Locale::Currency; @@ -15,7 +15,7 @@ require Exporter; # Public Global Variables #----------------------------------------------------------------------- use vars qw($VERSION @ISA @EXPORT); -$VERSION = sprintf("%d.%02d", q$Revision: 2.21 $ =~ /(\d+)\.(\d+)/); +$VERSION = sprintf("%d.%02d", q$Revision: 2.7 $ =~ /(\d+)\.(\d+)/); @ISA = qw(Exporter); @EXPORT = qw(&code2currency ¤cy2code &all_currency_codes &all_currency_names ); @@ -105,11 +105,11 @@ sub all_currency_names # initialisation code - stuff the DATA into the CODES hash #======================================================================= { - my $code; - my $currency; - + my $code; + my $currency; local $_; + while () { next unless /\S/; @@ -161,7 +161,7 @@ byb:Belarussian Ruble byr:Belarussian Ruble bzd:Belize Dollar -cad:Candian Dollar +cad:Canadian Dollar cdf:Franc Congolais chf:Swiss Franc clf:Unidades de Formento diff --git a/lib/Locale/Currency.pod b/lib/Locale/Currency.pod index 4678d3e..dce3261 100644 --- a/lib/Locale/Currency.pod +++ b/lib/Locale/Currency.pod @@ -179,7 +179,7 @@ Neil Bowers Eneil@bowers.comE =head1 COPYRIGHT -Copyright (C) 2002, Neil Bowers. +Copyright (C) 2002-2004, Neil Bowers. Copyright (c) 2001 Michael Hennecke and Canon Research Centre Europe (CRE). diff --git a/lib/Locale/Language.pm b/lib/Locale/Language.pm index 838e7e1..e8454c3 100644 --- a/lib/Locale/Language.pm +++ b/lib/Locale/Language.pm @@ -1,7 +1,7 @@ # # Locale::Language - ISO two letter codes for language identification (ISO 639) # -# $Id: Language.pm,v 2.2 2002/07/10 16:33:27 neilb Exp $ +# $Id: Language.pm,v 2.7 2004/06/10 21:19:34 neilb Exp $ # package Locale::Language; @@ -14,7 +14,7 @@ require Exporter; # Public Global Variables #----------------------------------------------------------------------- use vars qw($VERSION @ISA @EXPORT); -$VERSION = sprintf("%d.%02d", q$Revision: 2.21 $ =~ /(\d+)\.(\d+)/); +$VERSION = sprintf("%d.%02d", q$Revision: 2.7 $ =~ /(\d+)\.(\d+)/); @ISA = qw(Exporter); @EXPORT = qw(&code2language &language2code &all_language_codes &all_language_names ); @@ -104,11 +104,11 @@ sub all_language_names # initialisation code - stuff the DATA into the CODES hash #======================================================================= { - my $code; - my $language; - + my $code; + my $language; local $_; + while () { next unless /\S/; diff --git a/lib/Locale/Language.pod b/lib/Locale/Language.pod index 07ce4ba..ce7b378 100644 --- a/lib/Locale/Language.pod +++ b/lib/Locale/Language.pod @@ -147,7 +147,7 @@ Neil Bowers Eneil@bowers.comE =head1 COPYRIGHT -Copyright (C) 2002, Neil Bowers. +Copyright (C) 2002-2004, Neil Bowers. Copyright (c) 1997-2001 Canon Research Centre Europe (CRE). diff --git a/lib/Locale/Script.pm b/lib/Locale/Script.pm index d832b6a..f5fdbab 100644 --- a/lib/Locale/Script.pm +++ b/lib/Locale/Script.pm @@ -1,7 +1,7 @@ # # Locale::Script - ISO codes for script identification (ISO 15924) # -# $Id: Script.pm,v 2.2 2002/07/10 16:33:28 neilb Exp $ +# $Id: Script.pm,v 2.7 2004/06/10 21:19:34 neilb Exp $ # package Locale::Script; @@ -17,7 +17,7 @@ use Locale::Constants; # Public Global Variables #----------------------------------------------------------------------- use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); -$VERSION = sprintf("%d.%02d", q$Revision: 2.21 $ =~ /(\d+)\.(\d+)/); +$VERSION = sprintf("%d.%02d", q$Revision: 2.7 $ =~ /(\d+)\.(\d+)/); @ISA = qw(Exporter); @EXPORT = qw(code2script script2code all_script_codes all_script_names @@ -157,11 +157,11 @@ sub all_script_names # #======================================================================= { - my ($alpha2, $alpha3, $numeric); - my $script; - + my ($alpha2, $alpha3, $numeric); + my $script; local $_; + while () { next unless /\S/; diff --git a/lib/Locale/Script.pod b/lib/Locale/Script.pod index 8cc981e..93ff882 100644 --- a/lib/Locale/Script.pod +++ b/lib/Locale/Script.pod @@ -244,7 +244,7 @@ Neil Bowers Eneil@bowers.comE =head1 COPYRIGHT -Copyright (c) 2002 Neil Bowers. +Copyright (c) 2002-2004 Neil Bowers. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.