❗IMPORTANT
  • From this section, this documentation is for @nuxtjs/i18n v8 beta. if you would like to use v7.x, see the here
  • @nuxtjs/i18n next is still v8 beta, the API might subject to breaking changes. We will make every effort to have the same I/F as v7.x, but Nuxt 3 is a major release, it might not be the same I/F.
Check the Nuxt.js documentation for more information about installing and using modules in Nuxt.js.

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.js. You can use either of the following ways to specify the module options:

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

or

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