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
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,
# starting with list of languages/countries/currencies.
#
-BEGIN {
- chdir 't' if -d 't';
- @INC = '../lib';
-}
-
use Locale::Country;
use Locale::Language;
use Locale::Currency;
# constants.t - tests for Locale::Constants
#
-BEGIN {
- chdir 't' if -d 't';
- @INC = '../lib';
-}
-
use Locale::Constants;
print "1..3\n";
# country.t - tests for Locale::Country
#
-BEGIN {
- chdir 't' if -d 't';
- @INC = '../lib';
-}
-
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
['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
['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";
#
# currency.t - tests for Locale::Currency
#
-
-BEGIN {
- chdir 't' if -d 't';
- @INC = '../lib';
-}
-
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";
# 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');
#
# 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;
# 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);
=head1 COPYRIGHT
-Copyright (C) 2002, Neil Bowers.
+Copyright (C) 2002-2004, Neil Bowers.
Copyright (C) 2001, Canon Research Centre Europe (CRE).
#
# 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;
# 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
#
#=======================================================================
{
- my ($alpha2, $alpha3, $numeric);
- my ($country, @countries);
-
+ my ($alpha2, $alpha3, $numeric);
+ my ($country, @countries);
local $_;
+
while (<DATA>)
{
next unless /\S/;
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
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
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
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
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
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
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
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
=head1 COPYRIGHT
-Copyright (C) 2002, Neil Bowers.
+Copyright (C) 2002-2004, Neil Bowers.
Copyright (c) 1997-2001 Canon Research Centre Europe (CRE).
# 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;
# 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 );
# initialisation code - stuff the DATA into the CODES hash
#=======================================================================
{
- my $code;
- my $currency;
-
+ my $code;
+ my $currency;
local $_;
+
while (<DATA>)
{
next unless /\S/;
byr:Belarussian Ruble
bzd:Belize Dollar
-cad:Candian Dollar
+cad:Canadian Dollar
cdf:Franc Congolais
chf:Swiss Franc
clf:Unidades de Formento
=head1 COPYRIGHT
-Copyright (C) 2002, Neil Bowers.
+Copyright (C) 2002-2004, Neil Bowers.
Copyright (c) 2001 Michael Hennecke and
Canon Research Centre Europe (CRE).
#
# 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;
# 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 );
# initialisation code - stuff the DATA into the CODES hash
#=======================================================================
{
- my $code;
- my $language;
-
+ my $code;
+ my $language;
local $_;
+
while (<DATA>)
{
next unless /\S/;
=head1 COPYRIGHT
-Copyright (C) 2002, Neil Bowers.
+Copyright (C) 2002-2004, Neil Bowers.
Copyright (c) 1997-2001 Canon Research Centre Europe (CRE).
#
# 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;
# 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
#
#=======================================================================
{
- my ($alpha2, $alpha3, $numeric);
- my $script;
-
+ my ($alpha2, $alpha3, $numeric);
+ my $script;
local $_;
+
while (<DATA>)
{
next unless /\S/;
=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.