0

Hello I did a copy/paste from the vee-validate documentation into this codesandbox and I get no validation message - just the following error on the console:

[vue-i18n] Cannot translate the value of keypath 'validations.messages._default'. Use the value of keypath as default.

Is it a bug within vue-validate , vue-i18n, vuejs ? Or should one configurate it somehow different?

Alexander Mihailov
  • 1,050
  • 1
  • 12
  • 19

1 Answers1

1

you forgot to initialize i18n

After

const i18n = new VueI18n();

add this line

i18n.locale = "en";

this line tells i18n what the language it should look for, and merges all your translations (that you can have in a json file) with the veevalidator translations of the given language

CodeHacker
  • 2,127
  • 1
  • 22
  • 35
  • You are right about the line - it works! Thanks a lot! But it is the documentation who forgot it not me :) - I did just copy and paste without knowledge of how it exactly works – Alexander Mihailov Mar 07 '19 at 14:36
  • @AlexanderMihailov .. o yes.. the veevalidator is really good, but it's documentation is very incomplete – CodeHacker Mar 07 '19 at 15:35