Setup

Check the Nuxt.js documentation for more information about installing and using modules in Nuxt.js.

Add nuxt-i18n dependency to your project:

yarn add nuxt-i18n
npm install nuxt-i18n

Then, add nuxt-i18n to the modules section of nuxt.config.js:

nuxt.config.js
{
  modules: [
    'nuxt-i18n',
    { /* module options */ }
  ],
  // Or with global options
  i18n: {}
}

Typescript

If using typescript or running typescript language server to check the code (for example through Vetur), add types to types array in your tsconfig.json:

tsconfig.json
{
  "compilerOptions": {
    "types": [
      "@nuxt/types",
      "nuxt-i18n",
    ]
  }
}