diff options
Diffstat (limited to 'src/client/View/Plural.elm')
-rw-r--r-- | src/client/View/Plural.elm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/client/View/Plural.elm b/src/client/View/Plural.elm new file mode 100644 index 0000000..c36eaca --- /dev/null +++ b/src/client/View/Plural.elm @@ -0,0 +1,11 @@ +module View.Plural exposing + ( plural + ) + +import Model.Translations exposing (Translations, getMessage) + +plural : Translations -> Int -> String -> String -> String +plural translations n single multiple = + let singleMessage = getMessage translations single + multipleMessage = getMessage translations multiple + in (toString n) ++ " " ++ if n <= 1 then singleMessage else multipleMessage |