Closed paluh closed 4 years ago
Regarding i10l we can try to solve the issue by extending "UrlDecoded" values representation so they handle also "decoded" values and postpone localization till the rendering step. I mean provide closed sum type for values like:
data Value = String String | DateTime JsDatetime | Number Number | ...
In this way we can start validation from nearly the same layer but we can present values localized with the Intl
tools.
I've introduced a Message
effect into the stack. I'm going to provide specific L10n and I18n related tickets which should somewhat build on the top.
Unfortunately it seems that we won't be able to avoid another type (
Variant
based for sure ;-)) which should handle semantic representation of validation errors but also for form labels, help messages etc. This will allow customization of all predefined forms and validators. Additionally it would provide a layer for i18n machinery. The question remains how we are going to handle i10l in the context of automatic form prefill up. Do we really have to mess up thePolyform.Dual
with yet another type variable for the serializer "monad / profunctor etc"....