fix example

This commit is contained in:
Martin Janiczek
2020-04-24 14:54:43 +02:00
parent 8d80680579
commit 5e253909da
2 changed files with 15 additions and 3 deletions

View File

@@ -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"

View File

@@ -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" )
]
)
]