Search code examples
vue.jsvuejs2vee-validatevue-i18n

Vue-i18n Integration by vee-validate not working as described in the documentation


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?


Solution

  • 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