icanboogie/bind-cldr

Binds CLDR to ICanBoogie

v5.0.0 2018-12-01 13:27 UTC

This package is auto-updated.

Last update: 2024-12-21 00:18:51 UTC


README

Packagist Code Quality Coverage Status Downloads

Binds icanboogie/cldr to ICanBoogie, using its Autoconfig feature.

<?php

/** @var ICanBoogie\Application $app */

use ICanBoogie\CLDR\Repository;
use ICanBoogie\Binding\CLDR\CurrentLocale;

# Getting the CLDR
$cldr = $app->service_for_class(Repository::class);
echo $cldr->locale_for('fr')->format_number("1234567.89"); // 1 234 567,89

# Getting the current locale, defaulting to 'en' locale
$current_locale = $app->service_for_class(CurrentLocale::class);
echo $current_locale->get()->id->value             // en

# Change the current locale to 'fr'
$current_locale->set('fr')
echo $current_locale->get()->id->value             // fr

Installation

composer require icanboogie/bind-cldr

Continuous Integration

The project is continuously tested by GitHub actions.

Tests Static Analysis Code Style

Code of Conduct

This project adheres to a Contributor Code of Conduct. By participating in this project and its community, you are expected to uphold this code.

Contributing

Please see CONTRIBUTING for details.

License

icanboogie/bind-cldr is released under the BSD-3-Clause.