vee-validate
vee-validate copied to clipboard
[v3] fileld names are not changing with i18n untill I validate the form
What happened?
<ValidationProvider rules="required" ref="provider" vid="file" v-slot="{ errors }" :name="$t('app.themePicker.logo')" > <v-file-input :label="$t('app.themePicker.chooseLogo')" outlined prepend-icon="mdi-camera" @change="handleLogoChange" class="input-field-container font-sm" > </v-file-input> <span>{{ errors[0] }}</span> </ValidationProvider>
i'm using vue 2 with vuetify my validation errors is changing when I change locale but not the field Name, untill I validate the form the field name is changing
Reproduction steps
...
Version
Vue.js 2.x and vee-validate 3.x
What browsers are you seeing the problem on?
- [ ] Firefox
- [X] Chrome
- [ ] Safari
- [ ] Microsoft Edge
Relevant log output
No response
Demo link
codesandbox doesn't have a vue 2 template
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Sadly this is the way to go for this situation. I'm not currently working on v3 so I won't be able to fix this soon.
Unless someone is interested in fixing it.
I workaround this issue by adding they key props
< ValidationProvider :key="locale" .../>
Solved this issue by adding vee-validate messages to vue-i18n config and using defaultMessage configure, like in this example: https://vee-validate.logaretm.com/v3/guide/localization.html#using-other-i18n-libraries
ValidationProvider name changed to simple attribute without binding and translate function. Form re-validation is not necessary.
Incidentally, this issue also exists in v4, but I didn't try fixing it there yet.