diff options
Diffstat (limited to 'src/server/Model/Message.hs')
-rw-r--r-- | src/server/Model/Message.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/server/Model/Message.hs b/src/server/Model/Message.hs index 0e83e5b..026967f 100644 --- a/src/server/Model/Message.hs +++ b/src/server/Model/Message.hs @@ -2,6 +2,7 @@ module Model.Message ( getMessage , getParamMessage , getTranslations + , plural ) where import Data.Text (Text) @@ -28,3 +29,7 @@ getTranslation translationKey = Translation (T.pack . show $ translationKey) (getParts $ getNonFormattedMessage lang translationKey) + +plural :: Int -> Key -> Key -> Text +plural count singularKey pluralKey = + getParamMessage [T.pack . show $ count] (if count <= 1 then singularKey else pluralKey) |