Skip to content

getpoirot/cldr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[[ 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.

About

Provides an API to retrieve locale data from the CLDR

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages