¿Cómo se diz na vuestra, na nuestra llingua, la palabra futuru?
— Lecciones de gramática (Berta Piñán)
An attempt to bring in the data from CLDR into Raku.
The newest version (v0.5) aims to maintain functionality but vastly improve performance, both mainly from a speed perspective, but also improves memory efficiency and will aide long term maintenance.
There have been slight API changes from previous versions, so as noted before, if using, please ensure that you add version information to your use statements (at least until v.1.0);
Do not use anything outside of the Intl::CLDR from this branch. Those functionalities are in the process of being spun off into their own modules. This is primarily for obtaining more-or-less raw data with proper fallbacks.
To install, be aware that due to the number of files, you may need to increase the maximum number of open files (on most systems, the default is several thousand, but on macOS, it's a paltry 256).
> ulimit -n 4096
> zef install Intl::CLDR
Each CLDR-*
or CLDR::*
object is Associative
, and attributes can generally be accessed both from
hashy accessors ({'foo'}
) or method/attribute accessors (.foo
).
True attributes are defined with kebab-case, but camel-case alternates are available as well (this is because CLDR began with camel case, and now tends to prefer kebab-case, and it's hard to remember when to use which).
Because CLDR is designed to be stable, they have had to make some odd design choices for legacy compatibility.
An obvious example of this is the <codePatterns>
vs <localeDisplayPattern>
that really logically should go together.
This also happens with the dateFormats
, timeFormats
, and dateTimeFormats
.
The latter three are currently organized exactly as in CLDR, but I may rearrange these simply to provide a more convenient/logical method of accessing things (e.g. calendar.formats<time date datetime interval>
).
- 0.7.0 (in progress)
- New features
- Timezone data added
CLDR::Metazone
(from<metaZone>
) converts Olson IDs to notional zonesCLDR::WindowsTimezone
(from<windowsZones>
) to convert Windows' timezone IDs to Olson IDs
- Timezone data added
- New features
- 0.6.0
- CLDR update to v39.0
- New features
- Added language-agnostic
CLDR::Supplement
. Accessed viaCLDR.supplement.subdivisions
- Support for
<subdivisions>
tag (provides data to be fed into main language data classes)
- Support for
- Support for supplemental-ish
<grammaticalDerivations>
added (<grammaticalFeatures>
NYI). - Version attributes
- Use
CLDR.module-version
to get the current module version (currentlyv0.6.0
) - Use
CLDR.cldr-version
to get the version of the CLDR database used (currentlyv38.1
)
- Use
- Added language-agnostic
- Minor changes
- Removed redundant measurement type prefix from units (e.g. meter instead of length-meter).
- Hash-y access for
CompoundUnitSet::Selector
- Bug fixes
- Long/narrow display-name/per-unit patterns for simple units were swapped.
- Fixed encoding for exemplar characters that incorrect
.ellipses
and.more-info
values to appear inCLDR::Characters
- Locale display patterns
<localePattern>
(.main
),<localeSeparator>
(.separator
), and<localeKeyTypePattern>
(.extension
) are now properly encoded
- Code improvements
- Transition from using the
CLDR-ItemNew
inImmutability.pm6
(a holdover from pre-v0.5) to usingCLDR::Item
inCore.pm6
- Use
CLDR::Type
instead ofCLDR-Type
- Use
is aliased-by
instead ofdetour
- Use
is built
and similar instead of!bind_init
- Cleaner handling of cases in
Units.pm6
(to be mirrored in other similar files in subsequent updates)
- Transition from using the
- 0.5.1
- Updated
DecimalFormatSystem
,CurrencyFormatSystem
andScientificFormatSystem
to support Hash-y access. - Pulled out
Intl::Format::Numbers
into its own module (asIntl::Format::Number
) - Fixed an issue with
ExemplarCharacters
pre-processing, which caused a space to be added to every set - Pulled out
Intl::CLDR::Plural
into its own module (asIntl::Number::Plural
) - Support for supplemental
<plurals>
. (Found in new top level unitGrammar
) - Fixed a bug in
SimpleUnitSet
andCompoundUnitSet
that caused the wrong pattern to be returned
- Updated
- 0.5.0
- Redesigned data structure, and it's all about speed
- See docs for full details.
- Pulled out
Intl::Format::DateTime
into its own module - Pulled out
Intl::Format::List
into its own module - Not backwards compatible with v.0.4.3, make sure to specify version in
use
statement
- 0.4.3
- Fixed install issues
- Significant work towards fast attribute access (works on Calendar items)
- 0.4.2
- Added some new tokens , etc.
- Initial support for format-date and others.
- 0.4.1
- Greatly improved support for a token.
- Added support for Genders (only people, as that's what CLDR data has).
- 0.4.0
- Initial support for importing all CLDR data into a single repository in
Intl::CLDR
- DateTime formatting currently uses it.
- Number / list formatting will be updated in the near future to use it (they still maintain their own separate database ATM)
- Not all languages are fully supported because I'm too lazy to manually add them all to the META6 file (I'll eventually automate it)
- Initial support for importing all CLDR data into a single repository in
- 0.3.0
- Added support for formatting numbers of all types in the CLDR except for currency.
- Added preliminary support for finding localized numbers in grammars.
- 0.2.1
- Added preliminary support for Ge'ez numerals.
- Added preliminary support for Roman numerals.
- 0.2.0
- Added support for cardinal plural count.
- Ordinal should be working but there's a bug somewhere
- Added support for cardinal plural count.
- 0.1.0
- First working version. Support for list formatting.
The resources directory "cldr-common" comes directly from the Unicode CLDR data. These files are copyrighted by Unicode, Inc., and are available and distributed in accordance with their terms, which are also distributed in that directory.
Everything else (that is, all the Raku code), is licensed under the Artistic License 2.0 (see license file).