|\u003Cimg width=\"324\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/cd6f6927-33b3-4b85-a984-64c6cb1f53e5\" />|\n\n#### Proposed Feature: `localeDetector` Option\n\n##### Current Behavior Example\n\nTo illustrate the current behavior, consider the following scenario:\n\n* Accessing `/en/about` and `/ja/about` under the `no_prefix` strategy will not trigger locale detection based on the pathname.\n* As a result, both paths will use the language setting of the build machine during SSG, resulting in both paths potentially being generated in the same language.\n\nScreenshots and repository links demonstrating the current behavior will be provided to further clarify the issue.\n\nTo address this issue, I propose adding a new `localeDetector` option to the module configuration. This option allows specifying the methods for locale detection as follows:\n\n```typescript\ntype LocaleDetector = (\"pathname\" | \"domain\" | \"cookie\" | \"browser\")[];\n\nconst localeDetector: LocaleDetector = [\"pathname\", \"domain\", \"cookie\", \"browser\"];\n```\n\nIf `pathname` is specified, the locale will be automatically detected based on the URL pathname.\n\nThe default value of `localeDetector` will vary depending on the `strategy` value to maintain backward compatibility. For instance, when `no_prefix` is selected, the default value would be:\n\n```javascript\nlocaleDetector: [\"domain\", \"cookie\", \"browser\"]\n```\n\n##### Example Configuration for My Use Case:\n\n```javascript\nstrategy: \"no_prefix\",\nlocaleDetector: [\"pathname\", \"cookie\", \"browser\"]\n```\n\nThis configuration would resolve the issue by enabling locale detection based on pathname while maintaining backward compatibility with existing behavior.\n\nThank you for considering this feature request. I would be happy to provide further clarifications or contribute to the implementation if needed.\n\n\n### Additional information\n\n- [x] Would you be willing to help implement this feature?\n- [ ] Could this feature be implemented as a module?\n\n### Final checks\n\n- [x] Read the [contribution guide](https://nuxt.com/docs/community/contribution) (The contribution guideline of nuxt-modules/i18n is compliant with Nuxt too).\n- [x] Check existing [discussions](https://github.com/nuxt-modules/i18n/discussions) and [issues](https://github.com/nuxt/nuxt/issues).",[3041],{"name":3019,"color":3020},3609,"Add `localeDetector` option to customize locale detection during Vue component rendering","2025-05-16T18:51:35Z","https://github.com/nuxt-modules/i18n/issues/3609",0.70678484,{"description":3048,"labels":3049,"number":3051,"owner":3022,"repository":3023,"state":3024,"title":3052,"updated_at":3053,"url":3054,"score":3055},"### Environment\n\n- Node Version: v23.11.0\n- Nuxt Version: 3.17.5\n- Nitro Version: 2.11.12\n- @nuxtjs/i18n: 9.5.5\n- Package Manager: pnpm@9.5.0\n\n### Reproduction\n\nhttps://stackblitz.com/edit/bobbiegoede-nuxt-i18n-starter-5cgp8cfo?file=package.json,components%2FLangSwitcher.vue,pages%2Findex.vue,pages%2Fnews%2Findex.vue,pages%2Fnews%2F[slug]%2Findex.vue,nuxt.config.ts\n\n### Describe the bug\n\nWhen using a simple language switcher like this:\n\n```vue\n\u003Ctemplate>\n \u003Cdiv class=\"lang-switch\">\n \u003CNuxtLink\n v-for=\"availableLocale in availableLocales\"\n :key=\"availableLocale.code\"\n :to=\"switchLocalePath(availableLocale.code)\"\n >\n {{ availableLocale.name }}\n \u003C/NuxtLink>\n \u003C/div>\n\u003C/template>\n\n\u003Cscript setup>\nconst { locale, locales } = useI18n();\nconst switchLocalePath = useSwitchLocalePath();\nconst availableLocales = computed(() => {\n return locales.value.filter((i) => i.code !== locale.value);\n});\n\u003C/script>\n```\n\nIf you are on a dynamic route (e.g. `/news/[slug]`), navigating to another page causes Vue Router to warn:\n\n```\n[Vue Router warn]: Discarded invalid param(s) \"slug\" when navigating. See https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22 for more details.\n```\n\n## Expected behavior\nNo warning should be emitted when navigating, even from dynamic routes.\n\n## Actual behavior\nA warning is emitted every time the user navigates from a dynamic route to another page.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell\n[Vue Router warn]: Discarded invalid param(s) \"slug\" when navigating. \nSee https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22 for more details.\nlocalePathFor\t@\tindex.vue?t=1750772396716:31\n(anonymous)\t@\tindex.vue?t=1750772396716:51\n_sfc_render\t@\tindex.vue?t=1750772396716:48\n```",[3050],{"name":3019,"color":3020},3702,"Language switcher with switchLocalePath causes [Vue Router warn]: Discarded invalid param(s) \"slug\" on dynamic routes","2025-06-24T14:14:55Z","https://github.com/nuxt-modules/i18n/issues/3702",0.7071956,{"description":3057,"labels":3058,"number":3060,"owner":3022,"repository":3023,"state":3024,"title":3061,"updated_at":3062,"url":3063,"score":3064},"### Environment\n\n------------------------------\n- Operating System: Linux\n- Node Version: v20.19.1\n- Nuxt Version: 3.17.5\n- CLI Version: 3.25.1\n- Nitro Version: 2.11.12\n- Package Manager: npm@10.8.2\n- Builder: -\n- User Config: modules, devtools, nitro, i18n\n- Runtime Modules: @nuxtjs/i18n@9.5.5-29143926.54460af\n- Build Modules: -\n------------------------------\n\n### Reproduction\n\nhttps://stackblitz.com/edit/bobbiegoede-nuxt-i18n-starter-b5evupp3?file=nuxt.config.ts\n\n### Describe the bug\n\nWhen the site is generated or pre-rendered in `strategy: 'prefix'`, Browser language detection is not performed but the site always lands on the `defaultLocale` (`ja` in this case).\nThis is a bug present in both `V9` and `V10` and it would be nice to be fixed before the final release.\n\nCurrently the only solution I have found is to specify not to pre-render the `/` page and to start from the others (by the way it is not correct that this page is prerendered in `strategy: 'prefix'`):\n```js \n routeRules: {\n '/': {\n prerender: false,\n },\n '/ja': {\n prerender: true,\n },\n '/it': {\n prerender: true,\n },\n '/en': {\n prerender: true,\n },\n },\n```\n\n### Additional context\n\nI noticed this error when deploying to Netlify, but you can reproduce it with\n`nuxt build`\n`nuxt preview`\n\n### Logs\n\n```shell\n\n```",[3059],{"name":3019,"color":3020},3678,"Browser language detection on prerendering with `strategy: 'prefix'`","2025-06-05T15:21:38Z","https://github.com/nuxt-modules/i18n/issues/3678",0.7145698,{"description":3066,"labels":3067,"number":3071,"owner":3022,"repository":3023,"state":3072,"title":3073,"updated_at":3074,"url":3075,"score":3076},"### Describe the feature\n\n\r\nI have a project that heavily relies on several modules injecting pages. It is used to create websites for different countries by feeding country-config into nuxt-config. As a result, each module may inject a different set of pages based on the configuration.\r\n\r\nCurrently, I have found no way to define custom routes for pages injected through modules. \r\nI cannot use `customRoutes: 'page'` because it would require modifying all modules whenever we release the website for a new country. \r\nAlso, I cannot use `customRoutes: 'config'` since it cannot resolve AnalyzedNuxtPageMeta for injected pages.\r\n\r\nI wrote some details in discussions few days ago:\r\nhttps://github.com/nuxt-modules/i18n/discussions/2398\r\n\r\nI'd like to have an ability to define customRoutes based on route name instead of fs-like path. \r\nSo next 2 blocks will give same result:\r\n\r\n```js\r\ni18n: {\r\n customRoutes: 'config',\r\n pages: {\r\n 'my/[param]/page': {\r\n en: 'my/[param]/page',\r\n de: 'mein/[param]/seite'\r\n }\r\n }\r\n}\r\n```\r\n\r\n```js\r\ni18n: {\r\n customRoutes: 'named-config',\r\n pages: {\r\n 'my-param-page': { \r\n en: 'my/:param()/page',\r\n de: 'mein/:param()/seite'\r\n }\r\n }\r\n}\r\n```\r\n\r\n\r\n\n\n### Additional information\n\n- [X] Would you be willing to help implement this feature?\n- [ ] Could this feature be implemented as a module?\n\n### Final checks\n\n- [X] Read the [contribution guide](https://nuxt.com/docs/community/contribution) (The contribution guideline of nuxt-modules/i18n is compliant with Nuxt too).\n- [X] Check existing [discussions](https://github.com/nuxt-modules/i18n/discussions) and [issues](https://github.com/nuxt/nuxt/issues).",[3068],{"name":3069,"color":3070},"scope: routing","21CD73",2407,"closed","Add one more way to define custom routes. 'named-config'","2025-05-23T09:36:57Z","https://github.com/nuxt-modules/i18n/issues/2407",0.6464828,{"description":3078,"labels":3079,"number":3087,"owner":3022,"repository":3023,"state":3072,"title":3088,"updated_at":3089,"url":3090,"score":3091},"### Environment\n\n\"@nuxtjs/i18n\": \"^8.0.0-beta.10\",\n\n### Reproduction\n\nI have the following pages:\r\n- `terms.vue`\r\n- `terms-fi.vue`\r\n\r\nand my `nuxt.config.ts` has the following:\r\n```\r\n customRoutes: 'config', // disable custom route with page components\r\n pages: {\r\n terms: {\r\n fi: '/terms-fi',\r\n },\r\n },\r\n```\r\nIt works correctly when going from Finnish to English. Though when I am at `/fi/terms-fi` (the Finnish page) and I switch to english with `switchLocalePath` the routes becomes `terms-fi` and it should just be `terms`\n\n### Describe the bug\n\nError in the route when switching language if custom pages are defined.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[3080,3083,3084],{"name":3081,"color":3082},"🍰 p2-nice-to-have","0e8a16",{"name":3069,"color":3070},{"name":3085,"color":3086},"PR Welcome","40922A",2033,"Custom routes issue with switchLocalePath","2025-05-22T23:35:14Z","https://github.com/nuxt-modules/i18n/issues/2033",0.6669788,{"description":3093,"labels":3094,"number":3101,"owner":3022,"repository":3023,"state":3072,"title":3102,"updated_at":3103,"url":3104,"score":3105},"### Environment\n\n- Node Version: v20.11.0\r\n- Nuxt Version: 3.10.1\r\n- CLI Version: 3.10.0\r\n- Nitro Version: 2.8.1\r\n- Package Manager: yarn@4.0.1\r\n- Builder: -\r\n- User Config: modules, i18n, devtools\r\n- Runtime Modules: @nuxtjs/i18n@8.1.0\r\n- Build Modules: -\n\n### Reproduction\n\nhttps://stackblitz.com/edit/github-c7te5q-s3x21p?file=app.vue\n\n### Describe the bug\n\nAlso if i've set \r\n```js\r\nsetI18nParams({\r\n it: { blog: 'blog-1-it' },\r\n de: { blog: 'blog-1-de' },\r\n en: { blog: undefined },\r\n})\r\n```\r\n\r\nthe `og:locale:alternate` for the `en` lang it was addes\r\n\r\n```html\r\n\u003Cmeta id=\"i18n-og-alt-en\" property=\"og:locale:alternate\" content=\"en\">\r\n```\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[3095,3098],{"name":3096,"color":3097},"🔨 p3-minor-bug","fbca04",{"name":3099,"color":3100},"scope: seo","30CDE0",2782,"Allow disabling page per locale with `useSetI18nParams`","2025-05-25T10:23:04Z","https://github.com/nuxt-modules/i18n/issues/2782",0.67629945,{"description":3107,"labels":3108,"number":3113,"owner":3022,"repository":3023,"state":3072,"title":3114,"updated_at":3115,"url":3116,"score":3117},"### Describe the feature\n\nHi! I've a website with the following langs `it`, `de`, `en` and all the path in the translated lang have it's own path\r\n`/it/come-funziona`\r\n`/de/produkt`\r\n`/en/how-it-works`\r\n\r\nok, that's easy, I have de following config:\r\n```js\r\ndefineI18nRoute({\r\n locales: ['it', 'de', 'en'],\r\n\r\n paths: {\r\n it: '/come-funziona',\r\n de: '/produkt',\r\n en: '/how-it-works'\r\n }\r\n})\r\n```\r\n\r\nAnd if I have one less lang for a path it's something like: \r\n```js\r\ndefineI18nRoute({\r\n locales: ['it', 'en'],\r\n\r\n paths: {\r\n it: '/partner',\r\n en: '/partner'\r\n }\r\n})\r\n```\r\nOk, now the problem appear with dynamic pages. Because in the \"blog\" section not all articles are translated in all lang\r\n```js\r\ndefineI18nRoute({\r\n locales: ['it', 'en', 'de'],\r\n\r\n paths: {\r\n it: '/[blog]',\r\n en: '/[blog]',\r\n de: '/[blog]'\r\n }\r\n})\r\n\r\n// this specific article is not translated in `en`\r\nsetI18nParams({\r\n it: { blog: 'blog-1-it' },\r\n de: { blog: 'blog-1-de' },\r\n})\r\n```\r\n\r\nSo why is the following path added by default `/en/blog-1-it`? I think this behavior is similar to a bug. I don't want that to ever happen. Not even on non-dynamic pages\r\nI prefer something like\r\n```js\r\ndefineI18nRoute({\r\n paths: {\r\n it: '/partner',\r\n en: '/partner'\r\n }\r\n})\r\n```\r\nwithout having to specify the list of languages.\r\n\r\nBy default i have 3 langs, yes. And lang switcher always show 3 langs but if I don't set one it means that it doesn't exist, it makes no sense that only the `/en` prefix is changed and a route that doesn't exist is created.\r\nThis compromises the entire management of `rel=alternate` and SEO.\r\n\r\nI kindly ask you to give an answer to this question and look for a solution together because I think that the use of i18n is really complex if brought back to real management situations with a CMS.\r\nAfter almost a year of use there are still many problems related to SEO, changing languages, creating sitemaps, dynamic pages, etc.\r\n\r\nThank you very much\n\n### Additional information\n\n- [ ] Would you be willing to help implement this feature?\n- [ ] Could this feature be implemented as a module?\n\n### Final checks\n\n- [X] Read the [contribution guide](https://nuxt.com/docs/community/contribution) (The contribution guideline of nuxt-modules/i18n is compliant with Nuxt too).\n- [X] Check existing [discussions](https://github.com/nuxt-modules/i18n/discussions) and [issues](https://github.com/nuxt/nuxt/issues).",[3109,3112],{"name":3110,"color":3111},"feature request","ffbb00",{"name":3099,"color":3100},2784,"Remove the auto-complete alternate langs","2025-05-25T10:23:03Z","https://github.com/nuxt-modules/i18n/issues/2784",0.69023603,{"description":3119,"labels":3120,"number":3124,"owner":3022,"repository":3023,"state":3072,"title":3125,"updated_at":3126,"url":3127,"score":3128},"### Environment\r\n\r\n------------------------------\r\n- Operating System: Linux\r\n- Node Version: v18.16.0\r\n- Nuxt Version: 3.7.1\r\n- CLI Version: 3.7.3\r\n- Nitro Version: 2.6.2\r\n- Package Manager: pnpm@8.6.12\r\n- Builder: -\r\n- User Config: extends, telemetry, ssr, fontMetrics, nitro, routeRules, runtimeConfig, build, modules, delayHydration, image, components, bugsnag, devtools, i18n, experimental, pwa, app, dnGraphqlClient, vite, plugins\r\n- Runtime Modules: @nuxtjs/fontaine@0.4.1, @pinia/nuxt@0.4.11, @nuxt/devtools@0.8.2, @vite-pwa/nuxt@0.1.0, nuxt-bugsnag@7.0.0, @digitalnatives/css-variables/nuxt@5.1.3, @digitalnatives/graphql-client@4.0.3, @nuxtjs/i18n@8.0.0-rc.4, @nuxt/image@1.0.0-rc.1, nuxt-delay-hydration@1.2.1, @digitalnatives/composables@2.0.1\r\n- Build Modules: -\r\n------------------------------\r\n\r\n### Reproduction\r\n\r\nA naïve reproduction is the following:\r\n\r\n```js\r\nconst route = useRoute(); \r\nconst locale = useLocale();\r\n\r\n// On switch, this will first log the NEW locale with the OLD path, then it will trigger a second time, logging the NEW locale with the NEW path\r\nwatchEffect(() => {\r\n console.log(route.fullPath);\r\n console.log(locale);\r\n});\r\n```\r\n\r\nAdd it to a global component in the layout that doesn't get mounted/umounted on URI change.\r\n\r\n\r\n\r\n### Describe the bug\r\n\r\nWhen using prefixed routes and a language switcher as described in the docs, it seems the locale changes before the route does.\r\n\r\nWhen watching the locale with `useAsyncData()` or `useLazyAsyncData()` this will cause the results of this call to be associated with the wrong URL/path, which then has a side-effect of refetching API data which was already pre-rendered in Nuxt static mode. Therefore, the pre-rendered payload is NOT used in this pattern, even though it should.\r\n\r\nI've also seen this lead to data mismatching to the wrong paths, but this is a bit harder to create a reproduction for.\r\n\r\n### Additional context\r\n\r\nMy current workaround is this;\r\n\r\ncomposable:\r\n```js\r\nexport const useVariables = () => {\r\n const route = useRoute();\r\n const { $i18n }: any = useNuxtApp();\r\n // Don't automatically update the site and url to ensure they both change at the same time\r\n variables.uri = toValue(route.path);\r\n variables.lang = toValue($i18n?.localeProperties)?.apiLanguageHandle;\r\n\r\n // Update variables manually when the route changes, at this point both the locale AND the URI are correct.\r\n watch(() => route.path, () => {\r\n variables.uri = toValue(route.path);\r\n variables.lang = toValue($i18n?.localeProperties)?.apiLanguageHandle;\r\n });\r\n return { variables };\r\n});\r\n```\r\n\r\nthen:\r\n\r\n```js\r\nconst { variables } = useVariables();\r\nuseAsyncData(() => { console.log('trigger!') } , { watch: [ variables ] });\r\n```\r\n\r\n\r\nPerhaps it would be possible to inject the locale & locale properties into the localized route meta? That way we could just watch the route and apply the language from that.\r\n\r\nRelates to #2278 \r\n\r\n### Logs\r\n\r\n_No response_",[3121],{"name":3122,"color":3123},"switch locale","D2FCC6",2377,"`locale` changes BEFORE the route path does, which causes issues with (static) `asyncData`-payloads","2025-05-16T11:44:11Z","https://github.com/nuxt-modules/i18n/issues/2377",0.6944445,["Reactive",3130],{},["Set"],["ShallowReactive",3133],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fXImUcXutu_fyJqJDYU9N0O9z-59F4lfQS2ak9iYzwm4":-1},"/nuxt-modules/i18n/3716"]