Helper for rendering text based on a count number (like the I18n plural translation helper, but when translation is not needed).
Please note that we did not write any hard-coded rules for languages, as languages can evolve, we prefered to let the developer define the rules himself, instead of potentially break applications if we change rules in the future.
Set the plural rule to use
Parameters: | PluralRule|string – |
---|---|
Return type: | Plural |
Given an array of strings, a number and, if wanted, an optional locale (the default one is used otherwise), this picks the right string according to plural rules of the locale
Parameters: |
|
---|---|
Throws ExceptionInvalidArgumentException: | |
Return type: | string |