Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Support for querying Unicode's CLDR for li3.
PHP
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
config Allow CLDR resource to also be placed in app.
extensions/adapter/g11n/catalog Skip validation when locale is root.
resources Adding empty resources dir.
tests/cases/extensions/adapter/g11n/catalog Initial commit.
.gitignore Initial Project Commit
LICENSE.txt Adding license file.
README.md
composer.json Drop usage of --O for curl output.

README.md

li3_cldr

From the CLDR project site:

The Unicode CLDR provides key building blocks for software to support the world's languages, with the largest and most extensive standard repository of locale data available. This data is used by a wide spectrum of companies for their software internationalization and localization, adapting software to the conventions of different languages [...]

The core g11n implementation in Lithium already utilizes the CLDR indirectly through the intl php extension, which makes use of ICU, which in turn is based upon the data provided by the CLDR. So at first sight there seems to be no need to access the CLDR directly. As more and more features are added to the intl extension it does not provide a way to access certain data yet. With the CLDR Catalog adapter contained in this plugin you can query the CLDR for this data. Currently there's support for:

  • Postal code validation rules for most countries (validation.postalCode).
  • List and translation of currencies (currency).
  • List and translation of languages (language).
  • List and translation of territories (territory).
  • List and translation of scripts (script).

Installation

Clone the project into your libraries directory.

git clone git@github.com:UnionOfRAD/li3_cldr.git /path/to/project/libraries/li3_cldr

Make your Lithium app aware of the plugin by adding the following line to your bootstrap/libraries.php file.

Libraries::add('li3_cldr');

Resource Dependencies

Currently the plugin does not contain the actual CLDR data. We must take the following steps to install it. Download the ZIP file of the latest release, unpack it into a temporary directory and move the common directory into place.

curl http://unicode.org/Public/cldr/1.8.0/core.zip -o core.zip
unzip core.zip -d /tmp

mv /tmp/common /path/to/project/libraries/li3_cldr/resources/g11n
# ... or ...
mv /tmp/common /path/to/project/app/resource/g11n/cldr
Something went wrong with that request. Please try again.