Setup

❗IMPORTANT
  • From this section, this documentation is for Nuxt i18n module (@nuxtjs/i18n) v8 RC. If you would like to use v7.x, see here.
Check the Nuxt documentation for more information about installing and using modules in Nuxt.
Nuxt i18n module is using Vue I18n v9. please see Vue i18n docs for about how to usage.

Add @nuxtjs/i18n dependency to your project:

NPM
npm install @nuxtjs/i18n@next --save-dev
Yarn
yarn add --dev @nuxtjs/i18n@next
pnpm
pnpm add @nuxtjs/i18n@next --save-dev

Then, add @nuxtjs/i18n to the modules section in your nuxt.config. You can use either of the following ways to specify the module options:

nuxt.config.ts
export default defineNuxtConfig({
  modules: [
    '@nuxtjs/i18n',
  ],
  i18n: {
    /* module options */
  }
})

or

nuxt.config.ts
export default defineNuxtConfig({
  modules: [
    [
      '@nuxtjs/i18n',
      { /* module options */ }
    ]
  ]
})