icanboogie / bind-cldr
Binds CLDR to ICanBoogie
v5.0.0
2018-12-01 13:27 UTC
Requires
- php: >=7.2
- icanboogie/cldr: ^2.0|^3.0
- icanboogie/icanboogie: ^5.0
README
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.
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.