From f8c5ce08352950f4e74f3c51aa16ef366a9de9c7 Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Wed, 12 Aug 2015 11:37:29 +0200 Subject: Translating payment screen except dates --- src/client/Model/View/Payment/Add.elm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/client/Model/View/Payment') diff --git a/src/client/Model/View/Payment/Add.elm b/src/client/Model/View/Payment/Add.elm index 4665180..5428c3d 100644 --- a/src/client/Model/View/Payment/Add.elm +++ b/src/client/Model/View/Payment/Add.elm @@ -9,6 +9,8 @@ import Result as Result exposing (Result(..)) import Utils.Validation exposing (..) +import Model.Translations exposing (..) + type alias AddPayment = { name : String , nameError : Maybe String @@ -24,13 +26,13 @@ initAddPayment = , costError = Nothing } -validateName : String -> Result String String -validateName name = +validateName : String -> Translations -> Result String String +validateName name translations = name - |> validateNonEmpty "The category is required." + |> validateNonEmpty (getMessage "CategoryRequired" translations) -validateCost : String -> Result String Int -validateCost cost = +validateCost : String -> Translations -> Result String Int +validateCost cost translations = cost - |> validateNonEmpty "The cost is required." - |> flip Result.andThen (validateNumber "The cost must be a number.") + |> validateNonEmpty (getMessage "CostRequired" translations) + |> flip Result.andThen (validateNumber (getMessage "CostMustBeNumber" translations)) -- cgit v1.2.3