diff options
author | Joris Guyonvarch | 2015-08-10 23:30:31 +0200 |
---|---|---|
committer | Joris Guyonvarch | 2015-08-10 23:30:31 +0200 |
commit | a3bab4f2a0cc8a6a95753dc91d8e862f40c80dcc (patch) | |
tree | 3f8083a4f35fa959fc1a80479432c3b78a55e09e /src/server/Model/Json | |
parent | f860b59644e84b84b6d7b4af309161ca7c5499ee (diff) |
Embedding messages into the page
Diffstat (limited to 'src/server/Model/Json')
-rw-r--r-- | src/server/Model/Json/Message.hs | 16 | ||||
-rw-r--r-- | src/server/Model/Json/Translation.hs | 18 | ||||
-rw-r--r-- | src/server/Model/Json/Translations.hs | 17 |
3 files changed, 51 insertions, 0 deletions
diff --git a/src/server/Model/Json/Message.hs b/src/server/Model/Json/Message.hs new file mode 100644 index 0000000..354dd8f --- /dev/null +++ b/src/server/Model/Json/Message.hs @@ -0,0 +1,16 @@ +{-# LANGUAGE DeriveGeneric #-} + +module Model.Json.Message + ( Message(..) + ) where + +import Data.Aeson +import Data.Text (Text) +import GHC.Generics + +data Message = Message + { message :: Text + } deriving (Show, Generic) + +instance FromJSON Message +instance ToJSON Message diff --git a/src/server/Model/Json/Translation.hs b/src/server/Model/Json/Translation.hs new file mode 100644 index 0000000..7291157 --- /dev/null +++ b/src/server/Model/Json/Translation.hs @@ -0,0 +1,18 @@ +{-# LANGUAGE DeriveGeneric #-} + +module Model.Json.Translation + ( Translation(..) + ) where + +import GHC.Generics + +import Data.Aeson +import Data.Text + +data Translation = Translation + { key :: Text + , message :: Text + } deriving (Show, Generic) + +instance FromJSON Translation +instance ToJSON Translation diff --git a/src/server/Model/Json/Translations.hs b/src/server/Model/Json/Translations.hs new file mode 100644 index 0000000..21b188a --- /dev/null +++ b/src/server/Model/Json/Translations.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE DeriveGeneric #-} + +module Model.Json.Translations + ( Translations(..) + ) where + +import Data.Aeson +import GHC.Generics + +import Model.Json.Translation + +data Translations = Translations + { translations :: [Translation] + } deriving (Show, Generic) + +instance FromJSON Translations +instance ToJSON Translations |