|\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).",[2881],{"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.74763894,{"description":2888,"labels":2889,"number":2896,"owner":2871,"repository":2872,"state":2897,"title":2898,"updated_at":2899,"url":2900,"score":2901},"### 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_",[2890,2893],{"name":2891,"color":2892},"🔨 p3-minor-bug","fbca04",{"name":2894,"color":2895},"scope: seo","30CDE0",2782,"closed","Allow disabling page per locale with `useSetI18nParams`","2025-05-25T10:23:04Z","https://github.com/nuxt-modules/i18n/issues/2782",0.6431042,{"description":2903,"labels":2904,"number":2908,"owner":2871,"repository":2872,"state":2897,"title":2909,"updated_at":2910,"url":2911,"score":2912},"### 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_",[2905],{"name":2906,"color":2907},"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.68879473,{"description":2914,"labels":2915,"number":2925,"owner":2871,"repository":2872,"state":2897,"title":2926,"updated_at":2927,"url":2928,"score":2929},"### 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```",[2916,2919,2922],{"name":2917,"color":2918},"bug 🐛","ee0701",{"name":2920,"color":2921},"PR Welcome","40922A",{"name":2923,"color":2924},"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.6934667,{"description":2931,"labels":2932,"number":2936,"owner":2871,"repository":2872,"state":2897,"title":2937,"updated_at":2938,"url":2939,"score":2940},"### 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_",[2933],{"name":2934,"color":2935},"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.6981817,{"description":2942,"labels":2943,"number":2945,"owner":2871,"repository":2872,"state":2897,"title":2946,"updated_at":2947,"url":2948,"score":2949},"### Environment\n\n- Operating System: Darwin\n- Node Version: v23.9.0\n- Nuxt Version: 3.17.4\n- CLI Version: 3.25.1\n- Nitro Version: 2.11.12\n- Package Manager: bun@1.2.12\n- Builder: -\n- User Config: compatibilityDate, devtools, future, experimental, modules, runtimeConfig, css, app, ui, icon, fonts, image, nitro, i18n, turnstile\n- Runtime Modules: @nuxt/ui@3.1.2, @nuxt/image@1.10.0, @nuxt/scripts@0.11.7, @nuxtjs/i18n@9.5.4, @nuxtjs/turnstile@1.0.0, nuxt-auth-utils@0.5.20\n- Build Modules: -\n\n### Reproduction\n\nNuxtLinkLocale's job should be to just convert the to parameter to the correct path. Right now it does too much!\n\nWhether or not a link is external is not determined by target! It should only control the transformation of to.\n\n### Describe the bug\n\n#3252\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell\n\n```",[2944],{"name":2868,"color":2869},3631,"Respect NuxtLink props, just like NuxtLink respects VueRouteLink!","2025-05-22T11:29:36Z","https://github.com/nuxt-modules/i18n/issues/3631",0.7066097,{"description":2951,"labels":2952,"number":2958,"owner":2871,"repository":2872,"state":2897,"title":2959,"updated_at":2960,"url":2961,"score":2962},"### 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_",[2953,2956],{"name":2954,"color":2955},"scope: locales","006b75",{"name":2957,"color":2907},"scope: hooks",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.7102592,{"description":2964,"labels":2965,"number":2969,"owner":2871,"repository":2872,"state":2897,"title":2970,"updated_at":2971,"url":2972,"score":2973},"### Environment\n\n- Operating System: `Darwin`\n- Node Version: `v22.15.0`\n- Nuxt Version: `3.17.4`\n- CLI Version: `3.25.1`\n- Nitro Version: `2.11.12`\n- Package Manager: `npm@10.9.2`\n- Builder: `-`\n- User Config: `devtools`, `modules`, `i18n`, `compatibilityDate`, `app`\n- Runtime Modules: `@nuxtjs/i18n@9.5.4`\n- Build Modules: `-`\n\n\n### Reproduction\n\nhttps://github.com/cjpearson/switch-locale-path-repro\n\n### Describe the bug\n\nWhen using different domains for each locale, `switchLocalePath` will return an absolute URL for the current route in a different locale. However, if `app.baseURL` will not be included if it is set.\n\nFor example, calling `switchLocalePath` on `http://en.localhost/prefix/testing` will return `http://nl.localhost/testing`.\n\nThis is also the case when using path prefixes instead of domains, but less of an issue in practice since NuxtLink automatically adds the baseURL.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell\n\n```",[2966,2967],{"name":2917,"color":2918},{"name":2968,"color":2892},"domain",3628,"`switchLocalePath` should include the baseURL","2025-05-22T15:50:22Z","https://github.com/nuxt-modules/i18n/issues/3628",0.7180731,{"description":2975,"labels":2976,"number":2981,"owner":2871,"repository":2872,"state":2897,"title":2982,"updated_at":2983,"url":2984,"score":2985},"### Environment\r\n\r\n```\r\n❯ npx nuxi info\r\nWorking directory: /home/projects/github-q5ddsy 17:08:17\r\nNuxt project info: 17:08:17\r\n\r\n------------------------------\r\n- Operating System: Linux\r\n- Node Version: v18.20.3\r\n- Nuxt Version: 3.13.1\r\n- CLI Version: 3.13.1\r\n- Nitro Version: 2.9.7\r\n- Package Manager: npm@10.2.3\r\n- Builder: -\r\n- User Config: compatibilityDate, devtools, modules, pages, routeRules, i18n\r\n- Runtime Modules: @nuxtjs/i18n@8.5.3\r\n- Build Modules: -\r\n------------------------------\r\n\r\n 17:08:17\r\n👉 Report an issue: https://github.com/nuxt/nuxt/issues/new?template=bug-report.yml\r\n👉 Suggest an improvement: https://github.com/nuxt/nuxt/discussions/new\r\n👉 Read documentation: https://nuxt.com\r\n```\r\n\r\n### Reproduction\r\n\r\nReproduction here:\r\n\r\nhttps://stackblitz.com/edit/github-q5ddsy-62oh2a?file=.output%2Fpublic%2Findex.html\r\n\r\nSummary: Using nuxt-i18n with a default language and a translated language\r\n\r\n### Describe the bug\r\n\r\n**Please check the output index.html at**\r\n\r\n- either live in your browser\r\n- build the project with `npx nuxt build --preset github_pages`\r\n\r\nTake a look at the __auto-generated__ `\u003Clink>` elements, especially the `rel=\"alternate\"` & `red=\"canonical\"`:\r\n\r\n```html\r\n\u003Clink id=\"i18n-alt-en\" rel=\"alternate\" href=\"https://example.com/en\" hreflang=\"en\">\r\n\u003Clink id=\"i18n-alt-en-US\" rel=\"alternate\" href=\"https://example.com/en\" hreflang=\"en-US\">\r\n\u003Clink id=\"i18n-alt-de\" rel=\"alternate\" href=\"https://example.com\" hreflang=\"de\">\r\n\u003Clink id=\"i18n-alt-de-DE\" rel=\"alternate\" href=\"https://example.com\" hreflang=\"de-DE\">\r\n\u003Clink id=\"i18n-xd\" rel=\"alternate\" href=\"https://example.com\" hreflang=\"x-default\">\r\n\u003Clink id=\"i18n-can\" rel=\"canonical\" href=\"https://example.com\">\r\n```\r\n\r\nNotice, that the same URL `https://example.com` is being referred to, from: \r\n\r\n```\r\n\u003Clink id=\"i18n-xd\" rel=\"alternate\" href=\"https://example.com\" hreflang=\"x-default\">\r\n\u003Clink id=\"i18n-can\" rel=\"canonical\" href=\"https://example.com\">\r\n\u003Clink id=\"i18n-alt-de\" rel=\"alternate\" href=\"https://example.com\" hreflang=\"de\">\r\n```\r\n\r\nThat leads in SEO indexing/crawling, to an issue:\r\n\r\n- Bing Webmaster tools are complaining about the canonical link, referring to a link that is already marked as an alternative translation\r\n- Google Search Console is complaining about the same issue\r\n\r\nURL that I requested indexing for: https://waldemarenns.de/\r\n\r\nBing Webmaster Tools:\r\n\r\n```\r\nURL cannot be indexed by Bing\r\nThe URL is not indexable as the page is an alternate version of the similar page which you have specified as canonical version using a \u003Clink rel=\"canonical\"> tag. Bing does not index the alternate version.\r\nCanonical URL :https://waldemarenns.de/en\r\n```\r\n\r\n**Screenshot:**\r\n\r\n\r\n\r\nGoogle Page Speed Insights:\r\n\r\n```\r\nDocument does not have a valid rel=canonicalPoints to another `hreflang` location (https://waldemarenns.de/)\r\n```\r\n\r\n**Screenshot:**\r\n\r\n\r\n\r\nTake a look: https://pagespeed.web.dev/analysis/https-waldemarenns-de/30jj8518lg?form_factor=desktop\r\n\r\nℹ️ Feel free to inspect my site that is mentioned.\r\n\r\n### Additional context\r\n\r\nRefers to #2925\r\n\r\n### Logs\r\n\r\n_No response_",[2977,2980],{"name":2978,"color":2979},"❗ p4-important","d93f0b",{"name":2894,"color":2895},3099,"Build output has canonical link linking to the same URL as another alternate link, leading to SEO issues","2025-05-24T23:09:03Z","https://github.com/nuxt-modules/i18n/issues/3099",0.71851873,["Reactive",2987],{},["Set"],["ShallowReactive",2990],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fFYTe8-_QgPMsh50OnQbU2TdhtGMP3IimK9Jv9wjkV0c":-1},"/nuxt-modules/i18n/2780"]