ledgr/localefacade

This package is abandoned and no longer maintained. The author suggests using the symfony/intl package instead.

[Deprecated] OO wrapper to symfony/locale

1.0.1 2014-04-03 18:31 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:40:09 UTC


README

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.

LocaleFacade [deprecated]

OO wrapper to symfony/locale (and the Locale class of the Intl extension)

Installation

Install using composer

composer require ledgr/localefacade

Usage

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

Testing

To run the tests you must first install dependencies using composer.

$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar install
$ phpunit