Locale::Codes::Changes(3perl) | Perl Programmers Reference Guide | Locale::Codes::Changes(3perl) |
Locale::Codes::Changes - details changes to Locale::Codes
This describes the changes made to modules in the Locale-Codes distribution. Major changes are marked with asterisks (*). For the most part, all modules have remained backward compatible at every release, but occasionally a change is made which is backward incompatible. These are marked with an exclamation mark (!).
As of 3.00, the codes are autogenerated from the standards. With each release, codes will be re-generated and tested to see if any code changed. Any time there are any changes to the codes, it will be flagged below with a change: NEW CODE(s).
I intend to check for new codes four times a year (March, June, September, December). I will also check on request, so if a code changes that you use, feel free to contact me. Any time there are new codes, I will add them to the module and release a new version.
NEW CODE(s)
NEW CODE(s)
Thanks to p5p-porters (especially Dagfinn Ilmari Mannsaker) for discussion and guidance.
NEW CODE(s)
NEW CODE(s)
I have turned off error handling by default in the legacy modules. The show_errors method was added to each of the non-OO modules to report errors if desired.
Reported by dmaestro on GitHub.
NEW CODE(s)
NEW CODE(s)
NEW CODE(s)
Type Constants country LOCALE_CODE_* currency LOCALE_CURR_* language LOCALE_LANG_* script LOCALE_SCRIPT_* langfam LOCALE_LANGFAM_* langvar LOCALE_LANGVAR_* langext LOCALE_LANGEXT_*
For consistencies sake, I have added some new codes (which are otherwise identical to the irregularly named codes):
country LOCALE_COUNTRY_* currency LOCALE_CURRENCY_* language LOCALE_LANGUAGE_*
Going forward, all constants will include the full name of the code type.
All of the documentation for them is also generated except for the description of the code sets. That has been moved into the Locale::Codes::Types document.
NEW CODE(s) (Jiri Bohac noted that they were needed so this was release a couple weeks earlier than planned)
NEW CODE(s)
No new codes (for the existing codesets).
NEW CODE(s)
NEW CODE(s)
NEW CODE(s)
NEW CODE(s)
NEW CODE(s)
NEW CODE(s)
NEW CODE(s)
NEW CODE(s)
NEW CODE(s)
NEW CODE(s)
NEW CODE(s)
NEW CODE(s)
Some typos corrected. RT 85692
NEW CODE(s)
NEW CODE(s)
I will continue to support the FIPS-10 codeset as long as it is available, but at that point, it will be withdrawn immediately. If an official end-of-life date is announced, I will include a notice here. Otherwise, support for the codeset will be discontinued when the document is withdrawn.
You are encouraged to no longer use the FIPS-10 codeset.
NEW CODE(s)
NEW CODE(s)
NEW CODE(s)
NEW CODE(s)
NEW CODE(s)
NEW CODE(s)
Added language/script codes from the IANA language subtag registry
Fixed the return value for the all_XXX_codes and all_XXX_names functions. RT 69100
NEW CODE(s)
NEW CODE(s)
Changed 'use vars' to 'our'
NEW CODE(s)
NEW CODE(s)
NEW CODE(s)
NEW CODE(s)
NEW CODE(s)
The work done in each of the Locale::XXX modules was virtually identical to each other. It has all been moved to a central module and the Locale::XXX modules are now just wrappers.
country_code2code('bo',LOCALE_CODE_ALPHA_2,LOCALE_CODE_ALPHA_2); => undef
This doesn't seem like reasonable behavior, so it has been changed to allow the same code set:
country_code2code('bo',LOCALE_CODE_ALPHA_2,LOCALE_CODE_ALPHA_2); => 'bo'
Note that if an invalid code is passed in, undef will still be returned:
country_code2code('bol',LOCALE_CODE_ALPHA_2,LOCALE_CODE_ALPHA_2); => undef
The full set of routines includes:
rename_country rename_language rename_currency rename_script add_country add_language add_currency add_script delete_country delete_language delete_currency delete_script add_country_alias add_language_alias add_currency_alias add_script_alias delete_country_alias delete_language_alias delete_currency_alias delete_script_alias rename_country_code rename_language_code rename_currency_code rename_script_code add_country_code_alias add_language_code_alias add_currency_code_alias add_script_code_alias delete_country_code_alias delete_language_code_alias delete_currency_code_alias delete_script_code_alias
NEW CODE(s)
I contacted Neil to get his permission to assume maintenance of the module, and he kindly agreed.
As an example, the ISO 3166 standard which lists country codes refers to the country associated with the code "bo" as "Bolivia, Plurinational State of", so that is what is returned. In the 2.xx series, "Bolivia" was returned. Also, the country names vary from one standard to another. So the code "bol" which is maintained by the United Nations returns the name of the country as "Bolivia (Plurinational State of)". Some common aliases have been added, so you can still request a code associated with a county name "Bolivia".
Since the data comes from the standards, some "incorrect" values are no longer supported. For example, 2.07 treated "Zaire" as an alias for "Congo", but the country changed it's name, and "Zaire" is not in the standard, so it has been dropped in 3.00.
Alpha-3 and Term language codes (requested in RT 11730)
Numeric currency codes (requested in RT 18797)
As a result, the Locale::Script module is completely incompatible with the 2.xx version with respect to the types of codes it supports. None of the old codes will work.
language_code2code currency_code2code
so the interfaces for each type of codes are consistent.
Made $_ local in the initialization 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 misspelled 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)
The four modules which have data after __DATA__ weren't closing the DATA filehandle after reading from it, which they should. Bug and patch from Steve Hay.
Added three letter codes for the countries that were missing them. Patch from TJ Mather.
Documentation bug: one of the examples used => where the lvalue was a constant, which isn't allowed, unless you put the () with the constant to force the right interpretation. Pointed out by TJ Mather and MYT.
Updated the URL for the appendix in the CIA world factbook. Patch from TJ Mather.
Updated according to changes in ISO 3166-1 described in ISO 3166-1
newsletters V-4 and V-5, dated 2002-05-20:
- Kazakstan is now "Kazakhstan"
- Macau is now "Macao" The old names are retained as aliases.
The alpha-2 and alpha-3 codes for East Timor have changed:
tp -> tl
tmp -> tls the numeric code stays 626. If you want to support the old
codes, you can use the semi-private function alias_code().
Fixed a typo in the alias for the Vatican, reported (with patch) by Philip Newton.
Added "Moldova" as an alias for "Moldova, Republic of"
Updated Makefile.PL to include AUTHOR and ABSTRACT
Added semi-private routine rename_country() to Locale::Country, based on a patch from Iain Chalmers.
Added test rename.t for the above function.
Renamed _alias_code to be alias_code. Have retained the old name for backwards compatibility. Will remove it when the major version number next changes.
Split the documentation for all modules into separate pod files.
Made sure all =over were =over 4; some were other values.
The code2code() methods had one more shift than was needed.
Created Locale::Script which provides an interface to the ISO codes for identification of scripts (writing scripts, rather than perl style scripts). The codes are defined by ISO 15924, which is currently in final draft. Thanks to Jarkko for pointing out this new standard. All three code sets are supported, and a test-suite added.
Added support for country name variants to Locale::Country, so
that
country2code('USA')
country2code('United States')
country2code('United States of America') will all return 'us'. This had been
in the LIMITATIONS section since the first version. Patch from TJ Mather
with additional variants from me. Added test-cases for these.
Added VERSION to Locale::Constants. Thanks to Jarkko for pointing that it was missing.
Should really have bumped major version with previous release, since there was a change to the API.
Added Locale::Constants, which defines three symbols for identifying which codeset is being used:
LOCALE_CODE_ALPHA_2 LOCALE_CODE_ALPHA_3 LOCALE_CODE_NUMERIC
Updated Locale::Country to support all three code sets defined by ISO 3166. This was requested by Keith Wall. I haven't added multiple codeset support to the other modules yet - I'll wait until someone asks for them.
Added Locale::Currency, contribution from Michael Hennecke.
Added test suite for it (t/currency.t) and added test cases to t/all.t for the all_* functions.
Fixed very minor typos from 1.03!
Updated Locale::Country:
- fixed spelling of a few countries
- added link to a relevant page from CIA world factbook
Updated Locale::Language:
- fixed typo in the documentation (ISO 939 should be 639)
Updated Locale::Country and Locale::Language to reflect changes in the relevant ISO standards. These mainly reflect languages which are new to the relevant standard, and changes in the spelling of some country names.
Added official URLs for the standards to the SEE ALSO sections of the doc for each module.
Thanks to Jarkko Hietaniemi for pointing me at the pages with latest versions of ISO 3166 and 639.
Added Locale::Country::_alias_code() so that 'uk' can be added as the code for "United Kingdom", if you want it. This was prompted by Ed Jordan.
Added a new test suite for handling this case, and extended the existing test-suite to include testing of the case where 'uk' hasn't been defined as a valid code.
First public release to CPAN
Locale::Codes
See Locale::Codes for full author history.
Currently maintained by Sullivan Beck (sbeck@cpan.org).
Copyright (c) 2001-2010 Neil Bowers Copyright (c) 2010-2018 Sullivan Beck
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
2020-07-21 | perl v5.28.1 |