Help language development. Donate to The Perl Foundation
¿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.
As of v0.5.0, performance was vastly improved but some slight API changes were needed. Always ensure to use a version statement. (at least until v.1.0)
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::*
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>
).
CLDR::PercentFormats
and CLDR::ScientificFormats
to be fully aliased (needed to do, e.g., $percent-formats<latn>
)Immutability.pm6
CLDR::Symbols
Intl::CLDR
for correct data handling)/resources
into /tools
%?RESOURCES
existence check, instead uses foreknowledge of processed language files.CLDR::WindowsTimezone
(from <windowsZones>
) to convert Windows' timezone IDs to Olson IDsCLDR::Metazone
(from <metaZone>
) converts Olson IDs to notional zonesCLDR::Supplement
. Accessed via CLDR.supplement.subdivisions
<subdivisions>
tag (provides data to be fed into main language data classes)<grammaticalDerivations>
added (<grammaticalFeatures>
NYI).CLDR.module-version
to get the current module version (currently v0.6.0
)CLDR.cldr-version
to get the version of the CLDR database used (currently v38.1
)CompoundUnitSet::Selector
.ellipses
and .more-info
values to appear in CLDR::Characters
<localePattern>
(.main
), <localeSeparator>
(.separator
), and <localeKeyTypePattern>
(.extension
) are now properly encodedCLDR-ItemNew
in Immutability.pm6
(a holdover from pre-v0.5) to using CLDR::Item
in Core.pm6
CLDR::Type
instead of CLDR-Type
is aliased-by
instead of detour
is built
and similar instead of !bind_init
Units.pm6
(to be mirrored in other similar files in subsequent updates)DecimalFormatSystem
, CurrencyFormatSystem
and ScientificFormatSystem
to support Hash-y access.Intl::Format::Numbers
into its own module (as Intl::Format::Number
)ExemplarCharacters
pre-processing, which caused a space to be added to every setIntl::CLDR::Plural
into its own module (as Intl::Number::Plural
)<plurals>
. (Found in new top level unit Grammar
)SimpleUnitSet
and CompoundUnitSet
that caused the wrong pattern to be returnedIntl::Format::DateTime
into its own moduleIntl::Format::List
into its own moduleuse
statementIntl::CLDR
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).