lewyuburi / nuxt-validate

Simple Nuxt input validation module using vee-validate
https://www.npmjs.com/package/nuxt-validate
MIT License
122 stars 19 forks source link

Problems changing the languaage #31

Open sowinski opened 4 years ago

sowinski commented 4 years ago

Hi,

how can I change the language of nuxt-validate? I also use nuxt-i18n.

In the readme there is the following line:

notice: If you use nuxt-i18n module, declare the nuxt-validate module at before it. So my modules look like that at the moment.

  modules: [
    'bootstrap-vue/nuxt',
    '@nuxtjs/axios',
    '@nuxtjs/eslint-module',
    '@nuxtjs/sentry',
    'nuxt-validate',
    'nuxt-i18n'
  ],

So this is correct, right?

1) How can I change the language statically to for example french. 2) Why is nuxt-validate not picking the language from nuxt-i18n. What additional steps do I need?

Thank you!

sowinski commented 4 years ago

I think there is a bug "Using top level options".

If I write the options directly in the module like that everything works.

modules: [
    'bootstrap-vue/nuxt',
    '@nuxtjs/axios',
    '@nuxtjs/eslint-module',
    '@nuxtjs/sentry',
    ['nuxt-validate', {
      nuxti18n: true,
      classes: true,
      classNames: {
        valid: 'is-valid',
        invalid: 'is-invalid'
      },
      fieldsBagName: 'veeFields'
    }],
    'nuxt-i18n'
  ],

Can someone confirm this problem?

miteyema commented 4 years ago

@sowinski I confirm this problem too. I also solved it by passing the options directly.