NOTE: The symfony Locale component is deprecated since symfony 2.3, use the Intl component instead. LocaleFacade will not be updated as it is not necessary when using Intl.
For more information see the Intl documentation.
OO wrapper to symfony/locale (and the Locale class of the Intl extension)
Install using composer
composer require ledgr/localefacade
use ledgr\localefacade\LocaleFacade;
$l = new LocaleFacade('de');
// Prints 'Deutsch'
echo $l->getDisplayName();
// Prints 'Schweden'
echo $l->getDisplayCountries()['SE'];
$arr = array(
'ü',
'u',
'ß',
's'
);
$l->createCollator()->sort($arr);
// Prints 's, ß, u, ü'
print_r($arr);
// And all the other Locale methods...
To run the tests you must first install dependencies using composer.
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar install
$ phpunit