Get started with Nuxt i18n module.
v8
documentation compatible with Nuxt 3. @nuxtjs/i18n
as a dev dependency to your project:pnpm add -D @nuxtjs/i18n
@nuxtjs/i18n
to your nuxt.config
modules:export default defineNuxtConfig({
modules: ['@nuxtjs/i18n']
})
You can set the module options by using the i18n
property in nuxt.config
root.
export default defineNuxtConfig({
modules: ['@nuxtjs/i18n'],
i18n: {
// Module Options
}
})
Alternatively, You can pass an array of the module name and the options object to modules
export default defineNuxtConfig({
modules: [
[
'@nuxtjs/i18n',
{
// Module Options
}
]
]
})
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
:
{
"devDependencies": {
- "@nuxtjs/i18n": "^8.0.0"
+ "@nuxtjs/i18n": "npm:@nuxtjs/i18n-edge"
}
}
Then remove your lockfile and reinstall the dependencies.
Update @nuxtjs/i18n
dependency in your package.json
:
{
"devDependencies": {
- "@nuxtjs/i18n": "npm:@nuxtjs/i18n-edge"
+ "@nuxtjs/i18n": "^8.0.0"
}
}
Then remove your lockfile and reinstall the dependencies.