davestewart / vee-element

Replaces Element UI's validation engine with Vee Validate
http://vee-element.netlify.com
MIT License
73 stars 8 forks source link

use "label" for validation error messages when avaliable, make sure they are translated properly #2

Open bjoernklose opened 5 years ago

bjoernklose commented 5 years ago

Hey there, thanks for your great plugin, happily using it on a project currently. Only when also integrating i18n, there was a small issue that needed fixing.

Feel free to only use this as inspiration, as there are no proper tests etc. attached to this. Also, this is based on me playing around with the compiles .esm.js Version that is used in our project.

One final though / wish while we're at it: Do you plan on doing versioned releases soon? If so, something like release-it might help make things easier for you.

Thanks

davestewart commented 5 years ago

My first official user! 😝 (apart from me)

Yes, still some work to do around replacing the field message, I might ask for more information from you if that's OK. Are you saying that you basically want to use the label field as the i18n value?

Regarding the validateMessage assignment, errorField and errorForm are designed to read slightly differently:

I would like to add more customisation around this, maybe by way of a default function or other options.

Do you have any thoughts on this mechanism in general? I don't have any real foreign language experience - would this work for languages other than English? I should probably look again at the Vee Validate i18n files:

Localisation was the next planned demo anyway, so perfect timing. In fact, do you have a demo i18n setup you could upload as a repo, or even sample code to post?

Also, thanks for the tip on Release It - that looks really useful.

davestewart commented 5 years ago

So I like the way you've used label to replace the field value, I think that works really well! Except... where there is no label, for example the Date and Time fields in the complex demo.

Ideally we need a way to derive this.

Thoughts:

davestewart commented 5 years ago

FYI, I've raised an issue for the the/this field thing here:

Artem-Schander commented 5 years ago

Hello There .. it would be nice if this could be merged :)

davestewart commented 5 years ago

Sorry - I moved projects ages ago so this has all slipped in my priorities!

I need to look at everything again as I know Vee Validate has moved on since I looked at this last.