enflow / component-inflector
Multilingual inflector that can singularize and pluralize words.
Installs: 6 665
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^7.2.5
Requires (Dev)
- phpunit/phpunit: ~8.1
This package is auto-updated.
Last update: 2021-05-04 16:28:36 UTC
README
The enflow/component-inflector
package provides a easy way to singularize and pluralize words in multiple languages.
The following languages are currently supported. Pull requests are welcome!
- English (en)
- Dutch (nl)
Component is based on cakephp/utility
and noud/cakephp-dutch
.
Installation
You can install the package via composer:
composer require enflow/component-inflector
Usage
use Enflow\Component\Inflector\Inflector; $inflector = Inflector::forLanguageCode('en'); echo $inflector->singularize('apples') // Outputs: apple echo $inflector->pluralize('apple') // Outputs: apples
Or specify a custom language which extends the abstract Language
class:
use Enflow\Component\Inflector\Inflector; $inflector = Inflector::forLanguage(new YourLanguageClass());
Testing
$ composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email michel@enflow.nl instead of using the issue tracker.
Credits
Special thanks to Freek Van der Herten for providing the package template & multiple useful packages.
About Enflow
Enflow is a digital creative agency based in Alphen aan den Rijn, Netherlands. We specialize in developing web applications, mobile applications and websites. You can find more info on our website.
License
The MIT License (MIT). Please see License File for more information.