https://github.com/vehsamrak/phpluralize
Russian language pluralize rules library in PHP
https://github.com/vehsamrak/phpluralize
pluralization
Last synced: 8 days ago
JSON representation
Russian language pluralize rules library in PHP
- Host: GitHub
- URL: https://github.com/vehsamrak/phpluralize
- Owner: vehsamrak
- License: mit
- Created: 2018-10-02T08:19:58.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-02T20:24:25.000Z (over 6 years ago)
- Last Synced: 2025-03-30T10:31:33.350Z (about 1 month ago)
- Topics: pluralization
- Language: PHP
- Size: 13.7 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP Pluralize service
Russian language pluralize rules library in PHP.### Installation
Install the latest version with
```
composer require vehsamrak/phpluralize
```### Usage
Pluralizer accepts four parameters:
1. number of items
2. first pluralization form (for one item).
3. second pluralization form (for two item).
4. third pluralization form (for five items).Output will be valid pluralized string for a given number of items.
```php
pluralize(1, 'рубль', 'рубля', 'рублей'); // $string will be 'рубль'
$string = $pluralizer->pluralize(2, 'рубль', 'рубля', 'рублей'); // $string will be 'рубля'
$string = $pluralizer->pluralize(5, 'рубль', 'рубля', 'рублей'); // $string will be 'рублей'
$string = $pluralizer->pluralize(21, 'рубль', 'рубля', 'рублей'); // $string will be 'рубль'
```