aboutsummaryrefslogtreecommitdiff
path: root/common/src
diff options
context:
space:
mode:
Diffstat (limited to 'common/src')
-rw-r--r--common/src/Common/Message/Key.hs2
-rw-r--r--common/src/Common/Message/Translation.hs2
-rw-r--r--common/src/Common/Util/Text.hs8
3 files changed, 9 insertions, 3 deletions
diff --git a/common/src/Common/Message/Key.hs b/common/src/Common/Message/Key.hs
index ad8a7f1..a6828d5 100644
--- a/common/src/Common/Message/Key.hs
+++ b/common/src/Common/Message/Key.hs
@@ -118,7 +118,7 @@ data Key =
| SignIn_Button
| SignIn_DisconnectSuccess
| SignIn_EmailInvalid
- | SignIn_EmailPlaceholder
+ | SignIn_EmailLabel
| SignIn_EmailSendFail
| SignIn_EmailSent
| SignIn_LinkExpired
diff --git a/common/src/Common/Message/Translation.hs b/common/src/Common/Message/Translation.hs
index 0a6084d..13ced15 100644
--- a/common/src/Common/Message/Translation.hs
+++ b/common/src/Common/Message/Translation.hs
@@ -517,7 +517,7 @@ m l SignIn_EmailInvalid =
English -> "Your email is not valid."
French -> "Votre courriel n’est pas valide."
-m l SignIn_EmailPlaceholder =
+m l SignIn_EmailLabel =
case l of
English -> "Email"
French -> "Courriel"
diff --git a/common/src/Common/Util/Text.hs b/common/src/Common/Util/Text.hs
index 7e5c8c2..b49fc55 100644
--- a/common/src/Common/Util/Text.hs
+++ b/common/src/Common/Util/Text.hs
@@ -1,10 +1,16 @@
module Common.Util.Text
- ( unaccent
+ ( search
+ , unaccent
) where
import Data.Text (Text)
import qualified Data.Text as T
+search :: Text -> Text -> Bool
+search s t =
+ (format s) `T.isInfixOf` (format t)
+ where format = T.toLower . unaccent
+
unaccent :: Text -> Text
unaccent = T.map unaccentChar