aboutsummaryrefslogtreecommitdiff
path: root/src/server/Model/Json
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/Model/Json')
-rw-r--r--src/server/Model/Json/MessagePart.hs18
-rw-r--r--src/server/Model/Json/Translation.hs4
2 files changed, 21 insertions, 1 deletions
diff --git a/src/server/Model/Json/MessagePart.hs b/src/server/Model/Json/MessagePart.hs
new file mode 100644
index 0000000..0753d7c
--- /dev/null
+++ b/src/server/Model/Json/MessagePart.hs
@@ -0,0 +1,18 @@
+{-# LANGUAGE DeriveGeneric #-}
+
+module Model.Json.MessagePart
+ ( MessagePart(..)
+ ) where
+
+import Data.Text (Text)
+
+import Data.Aeson
+import GHC.Generics
+
+data MessagePart =
+ Order Int
+ | Str Text
+ deriving (Eq, Show, Generic)
+
+instance FromJSON MessagePart
+instance ToJSON MessagePart
diff --git a/src/server/Model/Json/Translation.hs b/src/server/Model/Json/Translation.hs
index 7291157..9dcfe80 100644
--- a/src/server/Model/Json/Translation.hs
+++ b/src/server/Model/Json/Translation.hs
@@ -9,9 +9,11 @@ import GHC.Generics
import Data.Aeson
import Data.Text
+import Model.Json.MessagePart
+
data Translation = Translation
{ key :: Text
- , message :: Text
+ , message :: [MessagePart]
} deriving (Show, Generic)
instance FromJSON Translation