diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/Model/Translations.elm | 3 | ||||
-rw-r--r-- | src/server/Model/Json/Translations.hs | 17 | ||||
-rw-r--r-- | src/server/Model/Message.hs | 5 |
3 files changed, 3 insertions, 22 deletions
diff --git a/src/client/Model/Translations.elm b/src/client/Model/Translations.elm index a6de961..bec8c9b 100644 --- a/src/client/Model/Translations.elm +++ b/src/client/Model/Translations.elm @@ -13,8 +13,7 @@ import String type alias Translations = List Translation translationsDecoder : Json.Decoder Translations -translationsDecoder = - ("translations" := Json.list translationDecoder) +translationsDecoder = Json.list translationDecoder type alias Translation = { key : String diff --git a/src/server/Model/Json/Translations.hs b/src/server/Model/Json/Translations.hs deleted file mode 100644 index 21b188a..0000000 --- a/src/server/Model/Json/Translations.hs +++ /dev/null @@ -1,17 +0,0 @@ -{-# 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 diff --git a/src/server/Model/Message.hs b/src/server/Model/Message.hs index f647ce2..a65e01c 100644 --- a/src/server/Model/Message.hs +++ b/src/server/Model/Message.hs @@ -12,7 +12,6 @@ import Model.Message.Lang import Model.Message.Translations (getNonFormattedMessage) import Model.Message.Parts -import Model.Json.Translations import Model.Json.Translation getMessage :: Key -> Text @@ -21,8 +20,8 @@ getMessage = getParamMessage [] getParamMessage :: [Text] -> Key -> Text getParamMessage values key = replaceParts values (getNonFormattedMessage lang key) -getTranslations :: Translations -getTranslations = Translations (map getTranslation [minBound..]) +getTranslations :: [Translation] +getTranslations = (map getTranslation [minBound..]) getTranslation :: Key -> Translation getTranslation key = Translation (T.pack . show $ key) (getParts $ getNonFormattedMessage lang key) |