Guide
Ignoring Localized Routes
Customize localized route exclusions per page component.
This feature is not supported when using the
'no_prefix'strategy unless you're also using differentDomains.If you'd like some pages to be available in some languages only, you can configure the list of supported languages to override the global settings. The options can be specified within either the page components themselves or globally, within the module configuration.
The
definePageMeta() examples work in all customRoutes modes, the defineI18nRoute() and pages examples require customRoutes to be set to 'page' (default) or 'config' respectively.Pick localized routes
// pages/about.vue
<script setup>
definePageMeta({
i18n: { locales: ['fr', 'es'] }
})
</script>
// pages/about.vue
<script setup>
defineI18nRoute({
locales: ['fr', 'es']
})
</script>
i18n: {
customRoutes: 'config',
pages: {
about: {
en: false,
}
}
}
Disable localized routes
// pages/about.vue
<script setup>
definePageMeta({ i18n: false })
</script>
// pages/about.vue
<script setup>
defineI18nRoute(false)
</script>
i18n: {
customRoutes: 'config',
pages: {
about: false
}
}