mirror of
https://github.com/jlengrand/elm-plural-rules.git
synced 2026-03-10 08:11:24 +00:00
fix example
This commit is contained in:
@@ -14,4 +14,10 @@ notificationMessage n =
|
||||
"Successfully deleted "
|
||||
++ String.fromInt n
|
||||
++ " "
|
||||
-- The below results in "messages": not found in the Rules -> defaultPluralize!
|
||||
++ Pluralize.pluralize n "message"
|
||||
++ " from "
|
||||
++ String.fromInt n
|
||||
++ " "
|
||||
-- The below results in "queries": found in Rules!
|
||||
++ Pluralize.pluralize n "query"
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
module Pluralize exposing (pluralize)
|
||||
|
||||
{-| An example of your custom-built module with a home-grown dictionary of words
|
||||
you use that can't be pluralized using `defaultPluralize` (adding `"s"` to the
|
||||
end of the word).
|
||||
-}
|
||||
|
||||
import PluralRules exposing (Cardinal(..), Rules)
|
||||
import PluralRules.En
|
||||
|
||||
@@ -7,9 +12,10 @@ import PluralRules.En
|
||||
rules : Rules
|
||||
rules =
|
||||
PluralRules.fromList
|
||||
[ ( "Query"
|
||||
, [ ( One, "Query" )
|
||||
, ( Other, "Queries" )
|
||||
-- see the usage in Main; note the ommision of "message" here!
|
||||
[ ( "query"
|
||||
, [ ( One, "query" )
|
||||
, ( Other, "queries" )
|
||||
]
|
||||
)
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user