Vee-validate: Cant change language using locale

Created on 31 Dec 2017  路  1Comment  路  Source: logaretm/vee-validate

Vee-Validate: 2.0

I am trying to change language like this in app.js file:

window.Vue = require('vue');
var VueValidation = require('vee-validate');
var VueValidationSwe = require('vee-validate/dist/locale/sv');

Vue.use(VueValidation, {
  locale: 'sv',
  dictionary: VueValidationSwe
});

I get no errors when I compile but the error messages still display in english.

Thanks

Most helpful comment

You are merging the locale as a root dictionary which doesn't work, try this instead:

window.Vue = require('vue');
var VueValidation = require('vee-validate');
var VueValidationSwe = require('vee-validate/dist/locale/sv');

Vue.use(VueValidation, {
  locale: 'sv',
  dictionary: {
    sv: VueValidationSwe
  }
});

>All comments

You are merging the locale as a root dictionary which doesn't work, try this instead:

window.Vue = require('vue');
var VueValidation = require('vee-validate');
var VueValidationSwe = require('vee-validate/dist/locale/sv');

Vue.use(VueValidation, {
  locale: 'sv',
  dictionary: {
    sv: VueValidationSwe
  }
});

Was this page helpful?
0 / 5 - 0 ratings

Related issues

saintplay picture saintplay  路  3Comments

yyyuuu777 picture yyyuuu777  路  3Comments

parweb picture parweb  路  3Comments

triffer picture triffer  路  3Comments

Youdaman picture Youdaman  路  3Comments