aboutsummaryrefslogtreecommitdiff
path: root/common/src/Common/Message
diff options
context:
space:
mode:
authorJoris2018-11-01 13:14:25 +0100
committerJoris2019-08-04 21:14:32 +0200
commit2741f47ef7b87255203bc2f7f7b2b9140c70b8f0 (patch)
treeea5f685cdf8f3de2efa1113325d45faaa90c977e /common/src/Common/Message
parent86957359ecf54c205aee1c09e151172c327e987a (diff)
Implementing client side validation
Diffstat (limited to 'common/src/Common/Message')
-rw-r--r--common/src/Common/Message/Key.hs1
-rw-r--r--common/src/Common/Message/Translation.hs9
2 files changed, 8 insertions, 2 deletions
diff --git a/common/src/Common/Message/Key.hs b/common/src/Common/Message/Key.hs
index 6e5f246..4acba93 100644
--- a/common/src/Common/Message/Key.hs
+++ b/common/src/Common/Message/Key.hs
@@ -39,6 +39,7 @@ data Key =
| Form_AlreadyExists
| Form_NonEmpty
+ | Form_MinChars Int
| Form_NonNullNumber
| Form_GreaterIntThan Int
| Form_InvalidCategory
diff --git a/common/src/Common/Message/Translation.hs b/common/src/Common/Message/Translation.hs
index 70eb978..e95fa74 100644
--- a/common/src/Common/Message/Translation.hs
+++ b/common/src/Common/Message/Translation.hs
@@ -162,6 +162,11 @@ m l Form_NonEmpty =
English -> "Required field"
French -> "Champ requis"
+m l (Form_MinChars number) =
+ case l of
+ English -> T.concat [ "This field must contains at least ", T.pack . show $ number, " characters" ]
+ French -> T.concat [ "Ce champ doit contenir au moins ", T.pack . show $ number, " caractères" ]
+
m l Form_NonNullNumber =
case l of
English -> "Number must not be null"
@@ -184,8 +189,8 @@ m l Form_InvalidColor =
m l Form_InvalidDate =
case l of
- English -> "day/month/year required"
- French -> "jour/mois/année requis"
+ English -> "DD/MM/YYYY required"
+ French -> "JJ/MM/AAAA requis"
m l Form_InvalidInt =
case l of