#1164·vuelidate

i18n documentation incomplete

Author: thisismydesignCreated Feb 24, 2023Updated Jul 23, 2025

Posted as a StackOverflow question as well.

Is your feature request related to a problem? Please describe.

I'm trying to follow https://vuelidate-next.netlify.app/advanced_usage.html#i18n-support

But there are multiple things unclear:

  • What is import { i18n } from "@/i18n"? I'm using @nuxtjs/i18n@v7 and not sure how to get global access to i18n. I'm not sure with vue-i18n either.
  • Are translations provided by this library or do I have to provide them? If so how?

Describe the solution you'd like

Docs with full examples to integrate i18n with nuxt and vue projects.

Describe alternatives you've considered

I found this workaround:

helpers/i18n-validators.ts

javascript
import * as validators from '@vuelidate/validators'
import { NuxtI18nInstance } from '@nuxtjs/i18n'

export const createRequired = (i18n: NuxtI18nInstance) => {
  const { createI18nMessage } = validators
  // It works™
  // @ts-ignore
  const withI18nMessage = createI18nMessage({ t: i18n.t.bind(i18n) })

  return withI18nMessage(validators.required)
}

Component.vue

javascript
import { createRequired } from '@/helpers/i18n-validators'
const required = createRequired($i18n)

Manually add translations (even english ones), e.g. validations.required.

Also found