Based on the provided knowledge sources, there isn't specific information about avoiding automatic localization of routes pushed within the pages:extend hook in Nuxt i18n. The knowledge sources don't contain enough information to directly answer your question about custom localization of routes injected through pages:extend.
However, I can provide some relevant information about the pages:extend hook in Nuxt:
The pages:extend hook allows you to add, change, or remove pages from the scanned routes at build time. This hook is called before the routes are processed further, including any potential i18n processing.
Docs > Guide > Recipes > Custom Routing mentions:
export default defineNuxtConfig({
hooks: {
'pages:extend' (pages) {
pages.push({
name: 'profile',
path: '/profile',
file: '~/extra-pages/profile.vue'
})
function removePagesMatching (pattern: RegExp, pages: NuxtPage[] = []) {
}
removePagesMatching(/\.ts$/, pages)
}
}
})
While this doesn't directly address your i18n concern, it shows how you can manipulate routes at this stage. To avoid automatic localization, you might need to explore options within the i18n module configuration or consider injecting your localized routes after the i18n processing has occurred.
For a more accurate and tailored solution to your specific use case with i18n, you may need to consult the Nuxt i18n module documentation or reach out to the Nuxt community forums for guidance on custom route localization within the pages:extend hook.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: