|\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.72524256,{"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.7350923,{"description":2888,"labels":2889,"number":2890,"owner":2871,"repository":2872,"state":2873,"title":2891,"updated_at":2892,"url":2893,"score":2894},"Hi, my nuxt application can be accessed through different domains, so I configured multiDomainLocales to work correctly.\nMy goal is that the SEO tags are changing based on the domain, is this possible? currently from any domain you can see the baseUrl that I configure from i18n in nuxt.config.ts.\nThese are my configurations:\n\n```typescript\n// nuxt.config.ts\nconst englishDomains = [/* ... */];\nconst portugueseDomains = [/* ... */];\nconst spanishDomains = [/* ... */];\n\nconst domains = [\n ...englishDomains,\n ...portugueseDomains,\n ...spanishDomains\n];\n\nexport default defineNuxtConfig({\n// ...\nsite: {\n multiTenancy: [\n { hosts: [/* ... */], config: { indexable: true, name: 'some name...', url: 'some url...' } },\n { hosts: [/* ... */], config: { indexable: true, name: 'some name...', url: 'some url...' } },\n { hosts: [/* ... */], config: { indexable: true, name: 'some name...', url: 'some url...' } },\n { hosts: [/* ... */], config: { indexable: true, name: 'some name...', url: 'some url...' } },\n { hosts: [/* ... */], config: { indexable: true, name: 'some name...', url: 'some url...' } },\n { hosts: [/* ... */], config: { indexable: true, name: 'some name...', url: 'some url...' } },\n { hosts: [/* ... */], config: { indexable: true, name: 'some name...', url: 'some url...' } },\n // Dev\n { hosts: [/* ... */], config: { indexable: false, name: 'some name Dev', url: 'some url...' } },\n { hosts: [/* ... */], config: { indexable: false, name: 'some name Dev', url: 'some url...' } },\n { hosts: [/* ... */], config: { indexable: false, name: 'some name Dev', url: 'some url...' } },\n { hosts: [/* ... */], config: { indexable: false, name: 'some name Dev', url: 'some url...' } },\n { hosts: [/* ... */], config: { indexable: false, name: 'some name Dev', url: 'some url...' } },\n { hosts: [/* ... */], config: { indexable: false, name: 'some name Dev', url: 'some url...' } },\n { hosts: [/* ... */], config: { indexable: false, name: 'some name Dev', url: 'some url...' } }\n ]\n},\n// ...\n i18n: {\n vueI18n: 'i18n.config.ts',\n strategy: 'prefix',\n baseUrl: 'https://somedomain.com',\n defaultLocale: 'es',\n detectBrowserLanguage: {\n useCookie: true,\n cookieKey: 'i18n_redirected',\n redirectOn: 'root'\n },\n multiDomainLocales: true,\n locales: [\n {\n code: 'en',\n file: 'en.json',\n domains,\n language: 'en-US',\n name: 'English',\n defaultForDomains: englishDomains\n },\n {\n code: 'es',\n file: 'es.json',\n domains,\n language: 'es-AR',\n name: 'Español',\n defaultForDomains: spanishDomains\n },\n {\n code: 'pt',\n file: 'pt.json',\n domains,\n language: 'pt-PT',\n name: 'Português',\n defaultForDomains: portugueseDomains\n }\n ],\n lazy: true\n },\n});\n// ...\n```\n\n```typescript\n// app.vue\n//...\nconst head = useLocaleHead({\n dir: true,\n key: 'id',\n seo: true\n});\n\nuseHead({\n htmlAttrs: {\n lang: head.value.htmlAttrs.lang,\n dir: head.value.htmlAttrs.dir\n },\n link: head.link,\n meta: head.meta\n});\n//...\n```",[],3635,"SEO and Multiple Domains","2025-05-22T19:19:28Z","https://github.com/nuxt-modules/i18n/issues/3635",0.7406639,{"description":2896,"labels":2897,"number":2902,"owner":2871,"repository":2872,"state":2873,"title":2903,"updated_at":2904,"url":2905,"score":2906},"### 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```",[2898,2899],{"name":2868,"color":2869},{"name":2900,"color":2901},"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.7581931,{"description":2908,"labels":2909,"number":2911,"owner":2871,"repository":2872,"state":2873,"title":2912,"updated_at":2913,"url":2914,"score":2915},"### Describe the feature\n\nCurrently, the files property in the locales configuration only supports an array of file paths. I would like to propose supporting a prefix option for each file to namespace its translations when loaded.\n```\ni18n: {\n locales: [\n {\n code: \"en\",\n name: \"English\",\n files: [\n { path: \"en/common.json\", prefix: \"common\" },\n { path: \"en/checkout.json\", prefix: \"checkout\" },\n { path: \"en/order.json\", prefix: \"order\" }\n ]\n }\n ]\n}\n```\nWith this configuration, the keys inside en/checkout.json would be accessible via t('checkout.key'), while en/common.json would be t('common.key'), and so on.\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).",[2910],{"name":2868,"color":2869},3593,"Support for file prefix in locales.files config","2025-05-11T07:15:31Z","https://github.com/nuxt-modules/i18n/issues/3593",0.75842756,{"description":2917,"labels":2918,"number":2920,"owner":2871,"repository":2872,"state":2921,"title":2922,"updated_at":2923,"url":2924,"score":2925},"### Environment\n\n### Version\n \n```\n- nuxt : \"^3.12.4\",\n- nuxtjs/i18n@8.5.2 || nuxtjs/i18n@8.0.0-rc.3 \n```\n\n### i18n.config.ts\n```\nlazy: true,\nlangDir: 'locales',\nstrategy: 'prefix',\ndefaultLocale: 'en',\nfallbackLocale: 'en',\ndetectBrowserLanguage: {\n redirectOn: 'root'\n},\ncompilation: {\n strictMessage: false\n},\nlocales: [\n { code: 'en', file: 'en.json' },\n { code: 'es', file: 'es.json' },\n { code: 'fr', file: 'fr.json' },\n { code: 'de', file: 'de.json' }\n]\n```\n\n### Reproduction\n\nFor reproduce need to close tabs can't do it by stackblitz.\n\n### Describe the bug\n\n### Example:\n\n```\n1. Open localhost:3000/de, the cookie is set correctly: i18n_redirected=de.\n2. Close the tab.\n3. In a new tab, type localhost:3000/de in the address bar, but don’t hit Enter.\n4. Replace /de with /es, then delete /es and press Enter to navigate to localhost:3000.\n```\n\n### Result:\nIt redirects to `/es`, although `/de` is expected — because there was no actual navigation to `/es`, only manual editing of the address bar.\nThe same happens when selecting a URL from the browser’s dropdown history.\n\nThis causes issues: the browser often autofills URLs with old locales, and even a brief appearance of something like `localhost:3000/en` may change the locale. The user won’t return to their original locale `/de` unless they manually reselect it.\n\nThis behavior is non-obvious. I couldn’t find anything in the docs about change the locale by manual browser bar without transition. Changing the strategy isn’t an option — it's tightly coupled with SEO and app logic.\n\n### Expected behavior:\nLocale should change only after explicit navigation, `not just by typing or selecting a URL in the browser` without transition.\n\n### Question:\nIs this expected behavior? Is there any way to change it via configuration?\n\n### Additional context\n\nIt doesn’t matter that this happens on localhost or production.\n\n### Logs\n\n```shell\n\n```",[2919],{"name":2868,"color":2869},3591,"closed","The locale changes without an actual navigation — just by typing the URL manually or selecting it from browser history.","2025-05-20T23:34:24Z","https://github.com/nuxt-modules/i18n/issues/3591",0.70132166,{"description":2927,"labels":2928,"number":2938,"owner":2871,"repository":2872,"state":2921,"title":2939,"updated_at":2940,"url":2941,"score":2942},"### 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_",[2929,2932,2935],{"name":2930,"color":2931},"🍰 p2-nice-to-have","0e8a16",{"name":2933,"color":2934},"scope: routing","21CD73",{"name":2936,"color":2937},"PR Welcome","40922A",2033,"Custom routes issue with switchLocalePath","2025-05-22T23:35:14Z","https://github.com/nuxt-modules/i18n/issues/2033",0.7017758,{"description":2944,"labels":2945,"number":2949,"owner":2871,"repository":2872,"state":2921,"title":2950,"updated_at":2951,"url":2952,"score":2953},"### 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_",[2946],{"name":2947,"color":2948},"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.7220918,{"description":2955,"labels":2956,"number":2963,"owner":2871,"repository":2872,"state":2921,"title":2964,"updated_at":2965,"url":2966,"score":2967},"### 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_",[2957,2960],{"name":2958,"color":2959},"🔨 p3-minor-bug","fbca04",{"name":2961,"color":2962},"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.72714245,{"description":2969,"labels":2970,"number":2979,"owner":2871,"repository":2872,"state":2921,"title":2980,"updated_at":2981,"url":2982,"score":2983},"### Describe the feature\n\nI am not sure if this is already possible, but I can not seem to figure it out.\r\nFor my site I am using differentDomains: true\r\nFor SEO purposes, I would like the baseURL to change whenever I switch local (or domain) which it does not seem to be doing right now.\r\nI am using the SEO module and for that to work properly I need to set up [the site config](https://nuxtseo.com/site-config/integrations/i18n).\r\n\r\nThe site link will be automatically set to the baseURL of the i18n module.\r\n\r\nI am also not sure if this is i18n module or seo module issue.\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).",[2971,2974,2977],{"name":2972,"color":2973},"feature request","ffbb00",{"name":2975,"color":2976},"need more info","e295d6",{"name":2978,"color":2901},"need reproduction",3053,"Change BaseURL when using different domains","2025-06-03T21:57:39Z","https://github.com/nuxt-modules/i18n/issues/3053",0.72801214,["Reactive",2985],{},["Set"],["ShallowReactive",2988],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fgfFywefVN2mvuNHiGt57MPbJ5UuCxTFDaCH0BG1bQiA":-1},"/nuxt-modules/i18n/2784"]