From 902acfbdbcc1d59941399753e887479e586e2748 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 26 Mar 2017 23:16:28 +0200 Subject: Improve form validation - Trim names - Income amount accepted from 0 - Validate colors --- src/server/Model/Message/Key.hs | 2 ++ src/server/Model/Message/Translations.hs | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'src/server/Model/Message') diff --git a/src/server/Model/Message/Key.hs b/src/server/Model/Message/Key.hs index 79ccf39..efe8aaa 100644 --- a/src/server/Model/Message/Key.hs +++ b/src/server/Model/Message/Key.hs @@ -130,6 +130,8 @@ data Key = | CostMustNotBeNull | InvalidInt | InvalidCategory + | InvalidColor + | AlreadyExists | SmallerIntThan | GreaterIntThan diff --git a/src/server/Model/Message/Translations.hs b/src/server/Model/Message/Translations.hs index 16fc3fd..90f509a 100644 --- a/src/server/Model/Message/Translations.hs +++ b/src/server/Model/Message/Translations.hs @@ -350,7 +350,7 @@ m l Color = m l UsedCategory = case l of English -> "This category is currently being used" - French -> "Cette catégorie est utilisée actuellement" + French -> "Cette catégorie est actuellement utilisée" -- Statistics @@ -513,6 +513,16 @@ m l InvalidCategory = English -> "Invalid category" French -> "Catégorie invalide" +m l InvalidColor = + case l of + English -> "Invalid color" + French -> "Couleur invalide" + +m l AlreadyExists = + case l of + English -> "Dupplicate field" + French -> "Doublon" + m l SmallerIntThan = case l of English -> "Integer bigger than {1} or equal required" -- cgit v1.2.3