Plural is a library that provides natural language pluralization functions for PHP.

Maintainers

👁 amasiye

Package info

github.com/atatusoft-ltd/plural

pkg:composer/atatusoft-ltd/plural

Statistics

Installs: 314

Dependents: 2

Suggesters: 0

Stars: 0

1.2.0 2024-12-18 13:28 UTC

Requires

  • php: ^8.3

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT c84308b569a0731033e50248424cec660601ba7e

  • Andrew Masiye <amasiye313.woop@gmail.com>

This package is auto-updated.

Last update: 2026-06-18 16:49:17 UTC


README

Overview

Plural is a library that provides natural language pluralization functions for PHP. The library currently supports the following languages:

  • English

However, Plural can easily be extended to support any language. If your language is not supported, you are encouraged to contribute a rules file to the project.

Usage

plural('dog'); # dogs
plural('matrix'); # matrices
plural('mouse'); # mice
plural('person'); # people
plural('sheep'); # sheep

Tests

Plural uses the PHPUnit unit testing framework to test the code. In order to run the tests, do the following from the project root directory:

$ phpunit tests/Plural.php

Requirements

Plural requires PHP version 5 or greater.

License

Plural is released under the terms of the MIT license. Please read the LICENSE file for further information.