diff options
author | Joris | 2017-11-28 09:11:19 +0100 |
---|---|---|
committer | Joris | 2017-11-28 09:11:19 +0100 |
commit | 49426740e8e0c59040f4f3721a658f225572582b (patch) | |
tree | 43e3cf19f35d672734a92648b0038bf48dace778 /common | |
parent | 554880727d833befab00666c7a4f95611e8370b9 (diff) |
Add search for payments
Diffstat (limited to 'common')
-rw-r--r-- | common/src/Common/Message/Key.hs | 2 | ||||
-rw-r--r-- | common/src/Common/Message/Translation.hs | 2 | ||||
-rw-r--r-- | common/src/Common/Util/Text.hs | 8 |
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 |