https://github.com/senseexception/intl-format
A wrapper library for PHP to format and internationalize values in messages like sprintf
https://github.com/senseexception/intl-format
formatter icu internationalization intl intl-format sprintf timezone
Last synced: 3 months ago
JSON representation
A wrapper library for PHP to format and internationalize values in messages like sprintf
- Host: GitHub
- URL: https://github.com/senseexception/intl-format
- Owner: SenseException
- License: mit
- Created: 2016-02-28T17:57:50.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2024-09-29T22:06:16.000Z (8 months ago)
- Last Synced: 2024-10-13T12:25:40.888Z (8 months ago)
- Topics: formatter, icu, internationalization, intl, intl-format, sprintf, timezone
- Language: PHP
- Homepage: http://senseexception.github.io/intl-format
- Size: 455 KB
- Stars: 12
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Intl-Format
A wrapper library for PHP to format and internationalize values in messages like sprintf[](https://packagist.org/packages/senseexception/intl-format)
[](https://packagist.org/packages/senseexception/intl-format)
[](https://github.com/SenseException/intl-format/actions?query=workflow%3ATests)
[](https://github.com/SenseException/intl-format/actions?query=workflow%3A%22Static+Analysis%22)
[](https://packagist.org/packages/senseexception/intl-format)### Why using this library?
Internationalisation is a very important matter when a PHP project covers more than just one country. Every country has
its own format for numbers, date or time. The Intl component offers functionality to handle all the formats you need,
but not always in a simple way.This library formats messages using the Intl component of PHP and offers a sprintf-like API.
Example:
```php
echo $intlFormat->format('Today\'s number is %number', 1000.3);
// echo "Today's number is 1'000,3" in case of locale de_CH
// echo "Today's number is 1,000.3" in case of locale en_US
```It is also easy extensible with your own custom formats.
## Documentation
Read more about this library in the [documentation](http://senseexception.github.io/intl-format).
## Does it affect [GDPR](https://www.eugdpr.org/) somehow?
Intl-Format itself uses the given data (e.g. timezone, locale) only for formatting purposes with the help of the
PHP Intl extension.## Installation
You can install this with [Composer](https://getcomposer.org/).
```
composer require senseexception/intl-format
```