|\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).",[2867],{"name":2868,"color":2869},"pending triage","c2e0c6",3609,"nuxt-modules","i18n","open","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.70429116,{"description":2879,"labels":2880,"number":2882,"owner":2871,"repository":2872,"state":2873,"title":2883,"updated_at":2884,"url":2885,"score":2886},"### Environment\n\n- Operating System: Darwin\n- Node Version: v22.15.0\n- Nuxt Version: 3.17.3\n- CLI Version: 3.25.1\n- Nitro Version: 2.11.12\n- Package Manager: npm@10.9.2\n- Builder: -\n- User Config: compatibilityDate, devtools, modules, i18n, nitro\n- Runtime Modules: @nuxt/content@3.5.1, @nuxtjs/i18n@9.5.4\n- Build Modules: -\n\n\n### Reproduction\n\nA minimal reproduction of this issue can be found in the following repository: https://github.com/odan-sandbox/nuxt-content-and-i18n-no_prefix-example\n\n\n### Describe the bug\n\nWhen using the `no_prefix` strategy in `nuxt-i18n`, the locale detection based on the URL pathname is not functioning as expected. This results in incorrect locale assignment during SSR/SSG.\n\nFor example, accessing `/en/about` and `/ja/about` should render the corresponding locale-specific content, but instead, both paths are rendered using the default or server locale, ignoring the locale information in the pathname.\n\nThis issue causes problems for multilingual documentation sites using `nuxt/content`, where the content is structured by locale (e.g., `docs/en/about.md`, `docs/ja/about.md`). During SSG, both paths may be generated with the same language content, leading to incorrect output.\n\nIf a PR to resolve this issue is considered appropriate, I would be willing to work on it.\n\n\n### Additional context\n\nRelated: https://github.com/nuxt-modules/i18n/issues/3609\n\n### Logs\n\n```shell\n\n```",[2881],{"name":2868,"color":2869},3619,"Locale detection not working with `no_prefix` strategy","2025-05-19T06:13:27Z","https://github.com/nuxt-modules/i18n/issues/3619",0.71088195,{"description":2888,"labels":2889,"number":2894,"owner":2871,"repository":2872,"state":2873,"title":2895,"updated_at":2896,"url":2897,"score":2898},"### Environment\n\nI am using @nuxtjs/i18n 9.5.4 with nuxt 3.17.3 for a statically generated website.\n\n\n### Reproduction\n\n-\n\n### Describe the bug\n\n\nIn nuxt.config.ts I have the default i18n settings:\n\n```\n\t\tdetectBrowserLanguage: {\n\t\t\tuseCookie: true,\n\t\t\tcookieKey: 'i18n_redirected',\n\t\t\tredirectOn: 'root'\n\t\t},\n```\n\nThe first time the site loads, before the i18n_redirected cookie exists, I see the following error in the console:\n\n```\nHydration completed but contains mismatches.\n```\n\nSubsequent visits to the site, once the cookie exists, do not have this error.\n\nI have confirmed that i18n locale detection is the issue by testing this configuration:\n\n```\n\t\tdetectBrowserLanguage: false\n```\n\nWhen detectBrowserLanguage is false, the issue does not occur.\n\nEDIT: Upon some further testing, the error only seems to occur if the browser locale that i18n matches is different from the defaultLocale. For example, if my browser locale is \"de\" but the i18n defaultLocale is \"en\" then the error will occur when i18n flips over to to the 'de' pages. By comparision, if the browser locale is \"en\", same as i18n defaultLocale, then the error will never occur. \n\nThe site renders fine, so it is not a big deal. But I'm wondering if there is anything that can be done to prevent that error from happening in the console on the initial load, before the cookie exists?\n\nThanks (in advance) for your help!\n\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell\n\n```",[2890,2891],{"name":2868,"color":2869},{"name":2892,"color":2893},"need reproduction 💻","CD234A",3608,"Hydration mismatch on initial static site load, before i18n cookie is set","2025-05-21T00:33:31Z","https://github.com/nuxt-modules/i18n/issues/3608",0.7118736,{"description":2900,"labels":2901,"number":2905,"owner":2871,"repository":2872,"state":2873,"title":2906,"updated_at":2907,"url":2908,"score":2909},"## Updates\n\n- 2024/01/02: Updated reproduction and steps to reproduce at https://github.com/nuxt-modules/i18n/issues/2524#issuecomment-1873823456\n- 2025/05/02: Updated reproduction for v9.5.4: https://github.com/nuxt-modules/i18n/issues/2524#issuecomment-2847024120\n\n## Original post\n\n### Environment\n\nWorking directory: /home/projects/aoniwxvlm.github 13:55:30\nNuxt project info: 13:55:30\n\n------------------------------\n- Operating System: Linux\n- Node Version: v18.18.0\n- Nuxt Version: 3.8.0\n- CLI Version: 3.9.1\n- Nitro Version: 2.7.0\n- Package Manager: npm@9.4.2\n- Builder: -\n- User Config: devtools, modules, i18n\n- Runtime Modules: @nuxtjs/i18n@8.0.0-rc.5\n- Build Modules: -\n------------------------------\n\n### Reproduction\n\nhttps://stackblitz.com/edit/github-fyaxh8\n\n### Describe the bug\n\nThe root redirect takes the `Accept-Language` header into account:\n\n```\ncurl -H \"Accept-Language: fr\" -I http://localhost:3000\n```\n\n```\nHTTP/1.1 302 Found\naccess-control-allow-origin: *\nlocation: /fr\ncontent-type: text/html\ndate: Wed, 25 Oct 2023 11:49:52 GMT\nconnection: close\n```\n\nBut everything else does not:\n\n```\ncurl -H \"Accept-Language: fr\" -I http://localhost:3000/foo\n```\n\n```\nHTTP/1.1 302 Found\naccess-control-allow-origin: *\nlocation: /en/foo\ncontent-type: text/html\ndate: Wed, 25 Oct 2023 11:49:41 GMT\nconnection: close\n```\n\nThis also relates to #2131 because I'm using the `prefix` strategy, which means I should actually get a 404 on the `/foo` request. Therefore, I think fixing #2131 will also fix this issue, but not vice versa.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[2902],{"name":2903,"color":2904},"browser language detection","c5def5",2524,"Inconsistent handling of `Accept-Language` header","2025-05-02T11:49:20Z","https://github.com/nuxt-modules/i18n/issues/2524",0.7367742,{"description":2911,"labels":2912,"number":2919,"owner":2871,"repository":2872,"state":2920,"title":2921,"updated_at":2922,"url":2923,"score":2924},"### 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).",[2913,2916],{"name":2914,"color":2915},"feature request","ffbb00",{"name":2917,"color":2918},"scope: seo","30CDE0",2784,"closed","Remove the auto-complete alternate langs","2025-05-25T10:23:03Z","https://github.com/nuxt-modules/i18n/issues/2784",0.69332904,{"description":2926,"labels":2927,"number":2931,"owner":2871,"repository":2872,"state":2920,"title":2932,"updated_at":2933,"url":2934,"score":2935},"### 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_",[2928],{"name":2929,"color":2930},"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.69689757,{"description":2937,"labels":2938,"number":2940,"owner":2871,"repository":2872,"state":2920,"title":2941,"updated_at":2942,"url":2943,"score":2944},"### Environment\n\n- Operating System: Linux\n- Node Version: v18.20.3\n- Nuxt Version: 3.16.0\n- CLI Version: 3.22.5\n- Nitro Version: 2.11.6\n- Package Manager: npm@10.2.3\n- Builder: -\n- User Config: compatibilityDate, devtools, modules\n- Runtime Modules: @nuxtjs/i18n@9.3.1\n- Build Modules: -\n\n### Reproduction\n\nhttps://stackblitz.com/edit/nuxt-starter-8ekrd9jd?file=pages%2Fpage1.vue\n\n### Describe the bug\n\nIf `navigateTo(localePath('/'))` in useLazyAsyncData is called before the useLocalePath composable, navigation does not occur server side. In the reproduction, if you click the link to page1 in the header the navigation is there. However, if you type in /page1 manually in the container you will see that you actually land there and not get redirected to index.\n\nIf you move const localePath = useLocalePath() to a line before useLazyAsyncData, the redirect will perform as expected on server side as well.\n\nIn the current state it just does nothing -> no navigation and no error.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell\n\n```",[2939],{"name":2868,"color":2869},3405,"navigateTo(localePath()) in useLazyAsyncData does nothing","2025-05-23T13:35:42Z","https://github.com/nuxt-modules/i18n/issues/3405",0.7076071,{"description":2946,"labels":2947,"number":2954,"owner":2871,"repository":2872,"state":2920,"title":2955,"updated_at":2956,"url":2957,"score":2958},"### Environment\n\n- Operating System: `Darwin`\n- Node Version: `v20.11.1`\n- Nuxt Version: `3.13.2`\n- CLI Version: `3.15.0`\n- Nitro Version: `2.9.7`\n- Package Manager: `npm@10.2.4`\n- Builder: `-`\n- User Config: `default`\n- Runtime Modules: `@nuxtjs/i18n@8.5.5`, `@pinia/nuxt@0.6.0`\n- Build Modules: `-`\n\n\n### Reproduction\n\nhttps://stackblitz.com/edit/github-paob67?file=plugins%2Finit.ts but for some reason stackblitz not setting cookie when using setLocale from useI18n;\n\n### Describe the bug\n\nWhen calling window.location.reload() immediately in callback in\nnuxtApp.hook('i18n:localeSwitched'), cookie and current language resets to a previous value.\n\n```\nnuxtApp.hook('i18n:localeSwitched', () => window.location.reload());\n```\n\nBut if you wrap reload in setTimeout it works as expected\n\n```\nnuxtApp.hook('i18n:localeSwitched', () => {\n setTimeout(() => window.location.reload(), 100);\n});\n```\n\n### Additional context\n\nIf this hook is async we should probably wait for it and then execute our callback?\n\n### Logs\n\n_No response_",[2948,2951],{"name":2949,"color":2950},"scope: locales","006b75",{"name":2952,"color":2953},"scope: hooks","CF3B0A",3192,"window.location.reload immediately after nuxtApp.hook('i18n:localeSwitched') not working as expected","2025-05-26T20:38:28Z","https://github.com/nuxt-modules/i18n/issues/3192",0.71661335,{"description":2960,"labels":2961,"number":2971,"owner":2871,"repository":2872,"state":2920,"title":2972,"updated_at":2973,"url":2974,"score":2975},"### Environment\n\n```\n- Operating System: Darwin\n- Node Version: v22.11.0\n- Nuxt Version: 3.13.2\n- CLI Version: 3.16.0\n- Nitro Version: 2.10.4\n- Package Manager: npm@10.9.0\n- Builder: -\n- User Config: default\n- Runtime Modules: @nuxtjs/i18n@9.1.0, @pinia/nuxt@0.7.0\n- Build Modules: -\n```\n\n### Reproduction\n\nhttps://stackblitz.com/edit/bobbiegoede-nuxt-i18n-starter-l8bdri?file=pages%2Ftest.vue,pages%2Findex.vue but it won't work in stackblitz so it needs to be reproduced in local environment\n\n### Describe the bug\n\nWhen using `\u003CNuxtLinkLocale>` with `to=\"/some-url-in-your-application\"` with `target=\"_blank\"`, locale prefix is not inserted in the resulting URL.\n\n### Additional context\n\nIn my opinion prefix should be added (or omitted if it is a default locale) as I use `\u003CNuxtLinkLocale>` here with exact purpose to direct to my application. Otherwise I would have used just an ordinary `\u003Ca>` tag or even `\u003CNuxtLink>`\n\n### Logs\n\n```shell\n\n```",[2962,2965,2968],{"name":2963,"color":2964},"bug 🐛","ee0701",{"name":2966,"color":2967},"PR Welcome","40922A",{"name":2969,"color":2970},"nuxt-link-locale","B327C3",3252,"NuxtLinkLocale with an attribute target=\"_blank\" does not respect the locale prefix","2025-05-22T15:26:02Z","https://github.com/nuxt-modules/i18n/issues/3252",0.72422117,{"description":2977,"labels":2978,"number":2981,"owner":2871,"repository":2872,"state":2920,"title":2982,"updated_at":2983,"url":2984,"score":2985},"### 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_",[2979],{"name":2980,"color":2953},"hook",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.7287486,["Reactive",2987],{},["Set"],["ShallowReactive",2990],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fIRgqAQKGTEprffavJ38dtZ1khbn9Kk0SO9O5kxeXpbY":-1},"/nuxt-modules/i18n/3591"]