defineI18nRoute()
is a compiler macro that you can use to set custom route paths for your page components located in the pages/
directory (unless set otherwise). This way you can set custom route paths for each static or dynamic route of your Nuxt application.
<script setup>
defineI18nRoute({
paths: {
en: '/about-us',
fr: '/a-propos',
ja: '/about-ja'
}
})
</script>
defineI18nRoute(route: I18nRoute | false) => void
interface I18nRoute {
paths?: Record<Locale, `/${string}`>
locales?: Locale[]
}
false
Disable localize for the target page component route.
I18nRoute
An object accepting the following i18n route settings:
paths
Record<Locale,
/${string}>
locales
Locale[]