Subject: | Locale::Language: support alias for countries |
Hiya,
At the moment, Locale::Country supports setting aliases for country _codes_, but does not allow for setting aliases of _countries_.
I'd like to alias "UK" and "U.K."--> "Great Britain" / "United Kingdom", so that we can preserve the ISO 3166-1 codes (ie - country2code( 'United Kingdom' ) should still return 'gb'), and so I will get back 'gb' when I call country2code( 'UK' ).
For example, in the perl debugger:
DB<1> use Locale::Country qw( country2code code2country )
DB<2> x country2code( 'UK' )
0 undef
DB<3> p country2code( 'U.K.' )
0 undef
DB<4> p country2code( 'United Kingdom' )
0 'gb'
DB<5> Locale::Country::alias_code('uk' => 'gb');
DB<6> p country2code( 'United Kingdom' )
0 'uk'
# This should still return 'gb'!
Ideally, I'd like to be able to say:
Locale::Country::alias_country('UK' => 'United Kingdom');
-Steve