Getting started
Installation
Get started with Nuxt i18n module.
Nuxt i18n module is using Vue I18n v10. See Vue i18n docs for more information.
For details specific to breaking changes in this update, check out the Breaking Changes.
Quick Start
- Install
@nuxtjs/i18n
as a dev dependency to your project:
npx nuxi@latest module add @nuxtjs/i18n
- Add
@nuxtjs/i18n
to yournuxt.config
modules:
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.
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
:
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
:
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.