diff --git a/mateamt.cabal b/mateamt.cabal index 1388b94..c25e6cf 100644 --- a/mateamt.cabal +++ b/mateamt.cabal @@ -20,6 +20,8 @@ category: Web extra-source-files: README.md CHANGELOG.md + translation/*.po + translation/*.pot flag develop description: Compile mateamt in developer mode. Authenitcation disabled. @@ -144,6 +146,7 @@ executable mateamt , case-insensitive , iproute , clock + , haskell-gettext hs-source-dirs: app default-language: Haskell2010 diff --git a/src/Control/User.hs b/src/Control/User.hs index 6af6739..61c919c 100644 --- a/src/Control/User.hs +++ b/src/Control/User.hs @@ -17,11 +17,14 @@ import Data.String (fromString) import qualified Data.Text as T +import Text.Printf (printf) + -- internal imports import Types import Model import Control.Role +import Util userNew :: UserSubmit @@ -161,12 +164,12 @@ userNotify (Just (auid, method)) boughtItems (PurchaseResult flag missing) = do ) boughtItems let messageText = mconcat $ map (<> "\n") $ - [ "Hello " <> userDetailsIdent userDetails <> "," + [ printf (__ "Hello %s,") (userDetailsIdent userDetails) + , "" + , printf (__ "Your authentication key with the comment \"%s\"\ + \ Just made following purchase:") + (authOverviewComment authOV) , "" - , "Your " <> ((fromString $ show $ authOverviewMethod authOV) <> - (" with the comment \"" <> - ((authOverviewComment authOV) <> - "\" Just made following purchase:"))) ] throwError $ err501 { errBody = "userNotify: Not implemented yet" diff --git a/src/Util.hs b/src/Util.hs index b777d2c..e21735a 100644 --- a/src/Util.hs +++ b/src/Util.hs @@ -30,3 +30,7 @@ initDB conn = do execute_ conn initRole execute_ conn initUserToRole void $ runInsertInitialRoles conn + +-- This is only a dummy function. +-- TODO: Replace with proper translation function(s)! +__ = id