|\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).",[2902],{"name":2868,"color":2869},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.737769,{"description":2909,"labels":2910,"number":2917,"owner":2871,"repository":2872,"state":2918,"title":2919,"updated_at":2920,"url":2921,"score":2922},"### Environment\n\n------------------------------\n- Operating System: Darwin\n- Node Version: v20.18.0\n- Nuxt Version: 3.16.0\n- CLI Version: 3.22.5\n- Nitro Version: 2.11.6\n- Package Manager: pnpm@9.12.2\n- Builder: -\n- User Config: modules, devtools, app, css, runtimeConfig, future, compatibilityDate, vite, postcss, eslint, i18n, image, prismic\n- Runtime Modules: @nuxt/eslint@1.2.0, @nuxtjs/prismic@4.1.0, @nuxt/fonts@0.11.0, @nuxtjs/i18n@9.3.1, @nuxt/image@1.9.0, @vueuse/nuxt@13.0.0\n- Build Modules: -\n------------------------------\n\n### Reproduction\n\nhttps://stackblitz.com/edit/bobbiegoede-nuxt-i18n-starter-w8n5eqto?file=pages%2Findex.vue\n\n### Describe the bug\n\n\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell\n\n```",[2911,2914],{"name":2912,"color":2913},"🍰 p2-nice-to-have","0e8a16",{"name":2915,"color":2916},"scope: components","B327C3",3402,"closed","Double nested `NuxtLinkLocale`","2025-05-30T19:25:27Z","https://github.com/nuxt-modules/i18n/issues/3402",0.7031092,{"description":2924,"labels":2925,"number":2929,"owner":2871,"repository":2872,"state":2918,"title":2930,"updated_at":2931,"url":2932,"score":2933},"### Environment\n\nReproducible On: @nuxt/nuxt 3.16.0 and beyond, when devtools v2 was introduced\n------------------------------\n- OS: macOS (Darwin) and Windows\n- Node: v22.15.0\n- Nuxt: 3.16.0 – 3.17.4\n- CLI: 3.25.1\n- Nitro: 2.11.12\n- Package Manager: bun@1.2.15 and npm (on Windows)\n- Runtime Modules: @nuxtjs/i18n@9.5.4\n- User Config: compatibilityDate, devtools, modules, i18n\n- Browsers: Firefox, Chrome, Safari — same result\n------------------------------\n\n### Reproduction\n\n\u003C!-- Failed to upload \"install.gif\" -->\n\n1. **Create a fresh Nuxt 3 project** \n ```bash\n bun create nuxt test\n cd test\n ```\n2. **Add the i18n module** \n ```bash\n bun x nuxi@latest module add @nuxtjs/i18n\n ```\n3. **Start the development server**\n4. **Enable the DOM Component Selector**\n5. **Attempt to click** on any element in the page.\n\n[Install Video](https://github.com/user-attachments/assets/9ecdf1fa-2faf-4375-8afa-cdcceb6fc0b7)\n\n[Version Video](https://github.com/user-attachments/assets/1d3afc61-7b7a-4ebe-a283-dd7c6620f0bb)\n\n\n### Describe the bug\n\n**I could not reproduce on stackblitz** but on Windows it's the same issue\n\nNuxt Devtools works normally until I try to use the DOM **Component Selector**. After clicking the selector icon, Devtools freezes: it no longer responds to clicks on elements or highlights components. The only way to restart Devtools is to refresh the page, and the issue immediately reoccurs when the selector is activated again.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell\nNo errors are shown in the terminal or browser console at the time of the freeze. Nuxt DevTools simply becomes unresponsive after enabling the Component Selector.\n```",[2926],{"name":2927,"color":2928},"possible regression","B78041",3653,"@nuxtjs/i18n is breaking @nuxt/devtools v2","2025-05-29T20:08:47Z","https://github.com/nuxt-modules/i18n/issues/3653",0.71176577,{"description":2935,"labels":2936,"number":2940,"owner":2871,"repository":2872,"state":2918,"title":2941,"updated_at":2942,"url":2943,"score":2944},"### 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_",[2937],{"name":2938,"color":2939},"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.7131258,{"description":2946,"labels":2947,"number":2954,"owner":2871,"repository":2872,"state":2918,"title":2955,"updated_at":2956,"url":2957,"score":2958},"### Environment\n\n- Nuxt version: 3.17.4\n- @nuxtjs/i18n version: 10.0.0-beta-7\n- Deployment target: Static site (nuxi generate)\n- Works fine in SSR build (nuxi build)\n- Node version: 22\n\n### Reproduction\n\nhttps://codesandbox.io/p/devbox/prod-https-6gz2f5\n\n- run `pnpm generate` command and check output folder. there is no i18n folder. \n- run `pnpm start` to run generate build. open browser console. you'll see `Failed to load messages for locale en FetchError: [GET] \"/_i18n/en/messages.json\":`\n\n### Describe the bug\n\nWhen generating a static site using `nuxi generate`, I get the following error in the console when loading the site:\n```\nFailed to load messages for locale en FetchError: [GET] \"/_i18n/en/messages.json\": 404 Not Found\n```\n\nThe same Nuxt app works fine with nuxtjs/i18n v9\n\nSetting `ssr: true` works fine for both build & generate \n\n### Additional context\n\nHere’s part of my nuxt.config.ts:\n```\n{\n defaultLocale: 'en',\n debug: import.meta.env.DEV,\n locales: [\n {\n code: 'en',\n language: 'en-US',\n file: 'en.json',\n name: 'English',\n },\n {\n code: 'es',\n file: 'es.json',\n name: 'Spanish',\n },\n {\n code: 'tl',\n file: 'tl.json',\n name: 'Tagalog (Filipino)',\n },\n ],\n strategy: 'no_prefix',\n detectBrowserLanguage: {\n useCookie: true,\n cookieKey: 'dmc.locale',\n redirectOn: 'root',\n },\n}\n```\n\n### Logs\n\n```shell\nTkPgtAp_.js:9 Failed to load messages for locale en FetchError: [GET] \"/_i18n/en/messages.json\": 404 Not Found\n at async s (N_fP37pm.js:19:23784)\n at async Object.loadLocaleMessages (N_fP37pm.js:53:9792)\n at async B1 (N_fP37pm.js:53:11552)\n at async setup (N_fP37pm.js:67:48664)\n at async t$ (N_fP37pm.js:19:30748)\n at async i (N_fP37pm.js:19:31273)\n at async N_fP37pm.js:19:31213\n at async Promise.all (:8080/index 5)\n at async N_fP37pm.js:19:31122\n at async i (N_fP37pm.js:19:31273)\n at async n$ (N_fP37pm.js:19:31324)\n at async Qk (N_fP37pm.js:1100:1993)\n```",[2948,2951],{"name":2949,"color":2950},"scope: ssg","85eac7",{"name":2952,"color":2953},"scope: ssr","0052cc",3645,"Failed to load messages for locale only in static site generated with nuxi generate (404 on /_i18n/en/messages.json)","2025-05-26T18:06:23Z","https://github.com/nuxt-modules/i18n/issues/3645",0.7214869,{"description":2960,"labels":2961,"number":2968,"owner":2871,"repository":2872,"state":2918,"title":2969,"updated_at":2970,"url":2971,"score":2972},"### 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_",[2962,2965],{"name":2963,"color":2964},"🔨 p3-minor-bug","fbca04",{"name":2966,"color":2967},"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.725263,{"description":2974,"labels":2975,"number":2979,"owner":2871,"repository":2872,"state":2918,"title":2980,"updated_at":2981,"url":2982,"score":2983},"### Environment\n\n- Operating System: Darwin\r\n- Node Version: v18.16.0\r\n- Nuxt Version: 3.6.2\r\n- Nitro Version: 2.5.2\r\n- Package Manager: yarn@1.22.19\r\n- Builder: vite\r\n- User Config: build, css, devtools, modules, nitro, postcss, routeRules, runtimeConfig\r\n- Runtime Modules: @pinia/nuxt@0.4.11, @nuxt/image@1.0.0-rc.1, nuxt-api-party@0.13.0, @nuxtjs/i18n@8.0.0-beta.13\r\n- Build Modules: -\n\n### Reproduction\n\nhttps://github.com/joeykamsteeg/nuxt3-i18n-beforelocaleswitch-hook-not-working\n\n### Describe the bug\n\nThis hook should be triggered on app load (according to the documentation) and with initialSetup property we could hook our own logic how to handle URLs without locale in the URL. This is now not possible.\r\n\r\nIssue was reported earlier (#2248) but was closed without a resolution. \n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[2976],{"name":2977,"color":2978},"hook","CF3B0A",2260,"Follow up: hook i18n:beforeLocaleSwitch does not use the locale that is return in the function","2025-05-22T19:39:58Z","https://github.com/nuxt-modules/i18n/issues/2260",0.7271551,["Reactive",2985],{},["Set"],["ShallowReactive",2988],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$ftxrGf49VrEpkbSLWG_GosCbPDwkQk6XfG_2uSMKd9lM":-1},"/nuxt-modules/i18n/2856"]