English is simple wrt. pluralization: it has just 1 vs "not 1".
The main gimmick of this module is adding "s" to the word unless your provided
Rules dictionary says it should behave differently.
Create your own dictionary of "non-s" pluralizations and a helper function that
provides that dictionary to the pluralize function. Here's an example (see also
the examples/ folder):
module Pluralize exposing (pluralize)
import PluralRules exposing (Cardinal(..), Rules)
import PluralRules.En
rules : Rules
rules =
PluralRules.fromList
[ ( "Query"
, [ ( One, "Query" )
, ( Other, "Queries" )
]
)
]
pluralize : Int -> String -> String
pluralize n word =
PluralRules.En.pluralize rules n wordA Float variant of pluralize.
Pluralization function for English rules (adding
"s"in the general case).Make your own helper function that gives
pluralizeyour rules, so that you don't need to mention them every time!(See the
examples/folder.)