aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/View/Plural.elm
blob: ab91f068ba73e8ee8d34ed74ea78d869d146b568 (plain)
1
2
3
4
5
6
7
8
9
10
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 single translations
      multipleMessage = getMessage multiple translations
  in  (toString n) ++ " " ++ if n <= 1 then singleMessage else multipleMessage