diff options
author | Joris Guyonvarch | 2015-08-12 10:16:59 +0200 |
---|---|---|
committer | Joris Guyonvarch | 2015-08-12 10:16:59 +0200 |
commit | d985e879e574c770453590791bc35352c2632d01 (patch) | |
tree | 15c4bb98b0f54e8557c6b4cbe527f5dd24cc0a9b /src/server/Model | |
parent | 892a7dd19a92fc18767984e624b8a5026dce61e4 (diff) |
Translating sign in page and mail
Diffstat (limited to 'src/server/Model')
-rw-r--r-- | src/server/Model/Mail.hs | 3 | ||||
-rw-r--r-- | src/server/Model/Message/Key.hs | 13 | ||||
-rw-r--r-- | src/server/Model/Message/Translations.hs | 63 |
3 files changed, 74 insertions, 5 deletions
diff --git a/src/server/Model/Mail.hs b/src/server/Model/Mail.hs index 7ee8a8e..20addee 100644 --- a/src/server/Model/Mail.hs +++ b/src/server/Model/Mail.hs @@ -6,7 +6,8 @@ import Data.Text (Text) import qualified Data.Text.Lazy as LT data Mail = Mail - { to :: [Text] + { from :: Text + , to :: [Text] , subject :: Text , plainBody :: LT.Text , htmlBody :: LT.Text diff --git a/src/server/Model/Message/Key.hs b/src/server/Model/Message/Key.hs index e1a382c..50486be 100644 --- a/src/server/Model/Message/Key.hs +++ b/src/server/Model/Message/Key.hs @@ -4,13 +4,24 @@ module Model.Message.Key data Key = + -- Mail + + NoReplyMail + -- Sign in - SharedCost + | SharedCost | SignIn | SendEmailFail | Unauthorized | EnterValidEmail + | SignInUsed + | SignInExpired + | SignInInvalid + | SignInMailTitle + | HiMail + | SignInLinkMail + | SignInEmailSent -- Dates diff --git a/src/server/Model/Message/Translations.hs b/src/server/Model/Message/Translations.hs index 2cc1761..d680e6e 100644 --- a/src/server/Model/Message/Translations.hs +++ b/src/server/Model/Message/Translations.hs @@ -5,6 +5,7 @@ module Model.Message.Translations ) where import Data.Text (Text) +import qualified Data.Text as T import Model.Message.Key import Model.Message.Lang @@ -14,6 +15,15 @@ getNonFormattedMessage = m m :: Lang -> Key -> Text +-- Mail + +m l NoReplyMail = + case l of + English -> "no-reply@shared-cost.guyonvarch.me" + French -> "pas-de-reponse@shared-cost.guyonvarch.me" + +-- Sign in + m l SharedCost = case l of English -> "Shared Cost" @@ -27,17 +37,64 @@ m l SignIn = m l SendEmailFail = case l of English -> "Sorry, we failed to send you the sign up email." - French -> "Désolé, nous n'avons pas pu vous envoyer le courriel de connexion." + French -> "Désolé, nous n'avons pas pu t'envoyer le courriel de connexion." m l Unauthorized = case l of English -> "You are not authorized to sign in." - French -> "Vous n'êtes pas authorisé à vous connecter." + French -> "Tu n'es pas authorisé à te connecter." m l EnterValidEmail = case l of English -> "Please enter a valid email address." - French -> "Entrez s'il vous plait un email valide." + French -> "Entre un email valide." + +m l SignInUsed = + case l of + English -> "You already used this link, please sign in again." + French -> "Tu as déjà utilisé ce lien, connecte-toi à nouveau." + +m l SignInExpired = + case l of + English -> "The link expired, please sign in again." + French -> "Le lien sur lequel tu as cliqué est expiré, connecte-toi à nouveau." + +m l SignInInvalid = + case l of + English -> "The link is invalid, please sign in again." + French -> "Le lien sur lequel tu as cliqué est invalide, connecte-toi à nouveau." + +m l SignInMailTitle = + case l of + English -> T.concat ["Sign in to ", m l SharedCost] + French -> T.concat ["Connexion à ", m l SharedCost] + +m l HiMail = + case l of + English -> "Hi {1}," + French -> "Bonjour {1}," + +m l SignInLinkMail = + case l of + English -> + T.concat + [ "Click to the following link in order to sign in to Shared Cost:" + , m l SharedCost + , ":" + ] + French -> + T.concat + [ "Clique sur le lien suivant pour te connecter à " + , m l SharedCost + , ":" + ] + +m l SignInEmailSent = + case l of + English -> "We sent you an email, please click to the provided link in order to sign in." + French -> "Nous t'avons envoyé un courriel, clique sur le lien dans ce mail pour te connecter." + +-- Date m l January = case l of |