diff options
author | Joris Guyonvarch | 2015-08-12 11:37:29 +0200 |
---|---|---|
committer | Joris Guyonvarch | 2015-08-12 11:37:29 +0200 |
commit | f8c5ce08352950f4e74f3c51aa16ef366a9de9c7 (patch) | |
tree | 51eede1c267da4c5927c6d4ccabbef6f63d6fd7a /src/client/Model | |
parent | d985e879e574c770453590791bc35352c2632d01 (diff) |
Translating payment screen except dates
Diffstat (limited to 'src/client/Model')
-rw-r--r-- | src/client/Model/View/Payment/Add.elm | 16 |
1 files changed, 9 insertions, 7 deletions
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)) |