Download the PHP package icanboogie/cldr without Composer
On this page you can find all versions of the php package icanboogie/cldr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download icanboogie/cldr
More information about icanboogie/cldr
Files in icanboogie/cldr
Package cldr
Short Description An API to localize applications using Unicode's CLDR
License BSD-3-Clause
Homepage https://icanboogie.org/
Informations about the package cldr
CLDR
The CLDR package facilitates the internationalization of your application by leveraging the data and conventions established by the Unicode Common Locale Data Repository (CLDR). It provides valuable locale information such as names for territories, languages, days… as well as formatters for numbers, currencies, dates and times, units, sequences, and lists.
Note
The package targets CLDR version 45; Revision 72.
Example usage
Installation
Documentation
The documentation is divided into the following parts, mimicking Unicode's documentation:
- Part 1: Core (languages, locales, basic structure)
- Part 2: General (display names & transforms, etc.)
- Part 3: Numbers (number & currency formatting)
- Part 4: Dates (date, time, time zone formatting)
- Part 5: Collation (sorting, searching, grouping)
- Part 6: Supplemental (supplemental data)
Getting started
The CLDR is represented by a Repository instance, which accesses data through a Provider instance. The package offers several and caching mechanisms. Choosing the right provider depends on your requirements: you may prioritize flexibility during development or predictability in production.
Favor flexibility
WebProvider offers maximum flexibility by retrieving data from the JSON distribution hosted on GitHub as needed. To minimize web requests, it is advised to use a collection of caches, each with its own strategy. For example, FileCache stores the retrieved data as PHP files, allowing it to benefit from opcache.
The following example demonstrates how a repository can be instantiated:
Favor predictability
For greater predictability, consider limiting the repository's usage to a few specific locales and distributing them as part of your application. You can prepopulate the CLDR cache during development and commit the files, or incorporate this step into your CI/CD pipeline build process.
Use the cldr command to warm up the CLDR cache:
The following example illustrates a setup to limit data access to the cache. RestrictedProvider throws an exception in an attempt to retrieve data not available in the cache.
Continuous Integration
The project is continuously tested by GitHub actions.
Code of Conduct
This project adheres to a Contributor Code of Conduct. By participating in this project and its community, you're expected to uphold this code.
Contributing
See CONTRIBUTING for details.
License
icanboogie/cldr is released under the MIT License.
All versions of cldr with dependencies
ext-curl Version *
ext-json Version *
ext-mbstring Version *
icanboogie/common Version ^1.3
icanboogie/accessor Version ^3.0|^4.0