# Installation ::callout{icon="i-heroicons-light-bulb"} Nuxt i18n module configures **Vue I18n v11** for your project, see the [Vue i18n documentation](https://vue-i18n.intlify.dev/){rel=""nofollow""} for in depth guides on the functionalities it provides. :: ## Quick Start 1. Install `@nuxtjs/i18n` as a dev dependency to your project: ```bash npx nuxi@latest module add @nuxtjs/i18n ``` 2. Add `@nuxtjs/i18n` to your `nuxt.config` modules: ```ts [nuxt.config.ts] export default defineNuxtConfig({ modules: ['@nuxtjs/i18n'] }) ``` ## Configuration You can set the module options by using the `i18n` property in `nuxt.config` root. ```ts [nuxt.config.ts] export default defineNuxtConfig({ modules: ['@nuxtjs/i18n'], i18n: { // Module Options } }) ``` ## Edge Channel ### Opting in You can opt in to the latest commits on the `main` branch to avoid waiting for the next release and helping the module by beta testing changes. Update `@nuxtjs/i18n` dependency in your `package.json`: ```diff [package.json] { "devDependencies": { - "@nuxtjs/i18n": "^9.0.0" + "@nuxtjs/i18n": "npm:@nuxtjs/i18n-edge" } } ``` Remove lockfile (`package-lock.json`, `yarn.lock`, or `pnpm-lock.yaml`) and reinstall dependencies. ### Opting out Update `@nuxtjs/i18n` dependency in your `package.json`: ```diff [package.json] { "devDependencies": { - "@nuxtjs/i18n": "npm:@nuxtjs/i18n-edge" + "@nuxtjs/i18n": "^9.0.0" } } ``` Remove lockfile (`package-lock.json`, `yarn.lock`, or `pnpm-lock.yaml`) and reinstall dependencies. # Usage ## Basic setup Let's start by configuring the project `locales` and the `defaultLocale` in the nuxt config. For this project we configure the locales with the following properties: - `code`: required property, the locale code is used throughout Nuxt I18n and is used as the identifier for the locale. - `name`: name of the locale, this is a user-friendly way to identify the locale. - `file`: a file that provides translation messages in the form of an object. The `defaultLocale` should be set to the `code` of one of the configured locales, setting this is optional but recommended as it will be used as fallback when navigating to a non-existent route. ```ts [nuxt.config.ts] export default defineNuxtConfig({ modules: ['@nuxtjs/i18n'], i18n: { defaultLocale: 'en', locales: [ { code: 'en', name: 'English', file: 'en.json' }, { code: 'nl', name: 'Nederlands', file: 'nl.json' } ] } }) ``` A typical project has at least one `file` for each configured locale, this file provides the translation messages in the form of an object. Nuxt I18n has a (configurable) folder structure from which the locale files are sourced, the locale files should be created in `/i18n/locales` by default. ::code-group ```json [i18n/locales/en.json] { "welcome": "Welcome" } ``` ```json [i18n/locales/nl.json] { "welcome": "Welkom" } ``` :: With this configuration we can add a basic language switcher and translate our first message using: ```vue [pages/index.vue] ``` Using the configured locales we created a simple language-switcher, by clicking a `