Ratings | | Unique User Downloads | | Download Rankings |
Not yet rated by the users | | Total: 36 | | All time: 10,715 This week: 200 |
|
Description | | Author |
This package can retrieve locale details from Unicode CLDR files.
It can parse XML files downloaded from the Unicode CLDR repository to extract locale details of several types.
Currently it can retrieve details extracted from CLDR files like:
- The language
- Territory
- The languages list
- The language name by locale
- The scripts list
- The scripts name by type
- The territories list
- A territory name
- The variants list
- A variant name
- The measurement system names
- The character order,
- A date fields name,
- A date relative time steps name
- A date future and past times name by count
- The time z one names list
- A time zone name by code
- A calendar era name
- A calendar era abbreviated name
- A calendar era narrow name
- The calendar months list
- A calendar month name | |
 |
|
Innovation award
 Nominee: 2x |
|
Details
[[ Work in progress ]]
I will put more example and documentation.
at very basic, you may use something like this:
$locale = \Locale::getDefault();
$mainProvider = new \Poirot\Cldr\DataProvider\MainProvider($locale);
echo $mainProvider->getCharacterOrder(); // right-to-left
/*
array(3) {
["metric"]=>
string(10) "?????"
["UK"]=>
string(20) "??????????"
["US"]=>
string(16) "????????"
}
*/
$mn = $mainProvider->getMeasurementSystemNames();
$mainProvider->setLocale('en');
echo $mainProvider->getTerritoryName('IR'); // Iran
/Use custom data path/
// Iran
echo $mainProvider->getRepoReader()
->getEntityByPath(
'localeDisplayNames/territories/territory',
array('type' => 'IR')
);
Support
To report bugs or request features, please visit the Issue Tracker.
Please feel free to contribute with new issues, requests and code fixes or new features.
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.