|\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).",[3018],{"name":3019,"color":3020},"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.59628284,{"description":3030,"labels":3031,"number":3033,"owner":3022,"repository":3023,"state":3024,"title":3034,"updated_at":3035,"url":3036,"score":3037},"### 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```",[3032],{"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.63891226,{"description":3039,"labels":3040,"number":3042,"owner":3022,"repository":3023,"state":3024,"title":3043,"updated_at":3044,"url":3045,"score":3046},"### Environment\n\n- Operating System: `Darwin`\n- Node Version: `v21.7.1`\n- Nuxt Version: `3.16.2`\n- CLI Version: `3.25.0`\n- Nitro Version: `2.11.9`\n- Package Manager: `npm@10.9.0`\n- Builder: `-`\n- User Config: `codegen`, `compatibilityDate`, `css`, `device`, `devtools`, `i18n`, `image`, `modules`, `runtimeConfig`, `scripts`, `srcDir`, `svgo`, `vite`, `watch`\n- Runtime Modules: `@bootstrap-vue-next/nuxt@0.29.3`, `@nuxt/eslint@1.3.0`, `@nuxt/fonts@0.11.2`, `@nuxt/image@1.10.0`, `@nuxt/scripts@0.11.6`, `@nuxtjs/device@3.2.4`, `@nuxtjs/i18n@9.5.3`, `@nuxtjs/stylelint-module@5.2.1`, `nuxt-svgo@4.0.19`, `nuxt-swiper@2.0.0`\n- Build Modules: `-`\n\n\n### Reproduction\n\nHere is the reproduction:\n\nhttps://stackblitz.com/edit/bobbiegoede-nuxt-i18n-starter-rskcxctd\n\n### Describe the bug\n\nWhen you translate your pages with defineI18nRoute (or maybe into `pages` key into i18n config) is getting rid when strategy in no prefixed (bot _no_prefix_ and _prefix_except_default_)\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell\n\n```",[3041],{"name":3019,"color":3020},3598,"defineI18nRoute is not working with no_prefix strategy","2025-05-13T14:21:14Z","https://github.com/nuxt-modules/i18n/issues/3598",0.6579355,{"description":3048,"labels":3049,"number":3051,"owner":3022,"repository":3023,"state":3024,"title":3052,"updated_at":3053,"url":3054,"score":3055},"### Environment\n\n- Operating System: `Darwin`\n- Node Version: `v22.14.0`\n- Nuxt Version: `3.17.6`\n- CLI Version: `3.25.1`\n- Nitro Version: `2.11.13`\n- Package Manager: `npm@10.9.2`\n- Builder: `-`\n- User Config: `compatibilityDate`, `devtools`, `modules`, `i18n`\n- Runtime Modules: `@nuxtjs/i18n@9.5.6`\n- Build Modules: `-`\n\n\n### Reproduction\n\n[https://github.com/ap-arto/define-i18n-route-issue](https://github.com/ap-arto/define-i18n-route-issue)\n \n1. Run the development server:`npm run dev`\n2. Visit localhost:3000\n3. Observe that the `spanish___es` route has been created, even though this domain is meant to serve only the `en` locale and the `/spanish` page shouldn't be available.\n\n### Describe the bug\n\nWhen using customRoutes: 'config' with manually specified pages, everything works as expected. However, defineI18nRoute appears to be broken in this edge case.\n\n### Additional context\n\nThis might be related to that issue: https://github.com/nuxt-modules/i18n/issues/3226\n\n### Logs\n\n```shell\n\n```",[3050],{"name":3019,"color":3020},3721,"defineI18nRoute includes routes for other locales when using 'no_prefix' and differentDomains","2025-07-11T09:46:02Z","https://github.com/nuxt-modules/i18n/issues/3721",0.686746,{"description":3057,"labels":3058,"number":3060,"owner":3022,"repository":3023,"state":3024,"title":3061,"updated_at":3062,"url":3063,"score":3064},"### Describe the feature\n\n### Description\n\nHi there,\nI'm working on a Nuxt project that needs to serve multiple countries, each on a separate domain. Each domain has its own i18n requirements:\n\n* Some domains have **only one official language** (e.g., `site.fr` → French only, no prefix needed).\n* Others have **multiple languages**, and the strategy varies:\n\n * Some use `prefix_except_default` (e.g., `site.ca` with `fr` and `en`)\n * Others use `prefix` (e.g., `site.be` with `fr` and `nl`)\n\n### Constraints:\n\n* I want to **use a single Nuxt build** to serve all domains.\n* I need to **dynamically adapt the i18n config** (strategy, locales, defaultLocale) based on the current domain (host).\n* I also need to **detect the current domain** at runtime (server & client) to configure things like API base URLs.\n* Compatible with SSR & SEO\n\n### Problem\n\nCurrently, I need to generate and deploy **one build per domain** to accommodate the differences in `strategy`, `defaultLocale`, and available `locales`. That means I must build the app **8 times**, which is time-consuming and hard to maintain.\n\n### Question\n\nIs there currently any **official or recommended way** to support multiple domains with different i18n strategies **using a single build**?\n\nIf not, would this be considered a valid feature request, or are there technical constraints that prevent this kind of setup?\n\nThanks a lot for your help!\n\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).",[3059],{"name":3019,"color":3020},3748,"Support complex multi-domain i18n configurations in a single build","2025-07-22T22:16:46Z","https://github.com/nuxt-modules/i18n/issues/3748",0.6903827,{"description":3066,"labels":3067,"number":3074,"owner":3022,"repository":3023,"state":3075,"title":3076,"updated_at":3077,"url":3078,"score":3079},"### Environment\n\n- Operating System: Windows 11\n- Node Version: 18.18.2\n- Nuxt Version: 3.15.0\n- @nuxtjs/i18n: 9.5.3\n\n### Reproduction\n\nhttps://stackblitz.com/edit/bobbiegoede-nuxt-i18n-starter-7rohnkcc?file=nuxt.config.ts\n\n### Describe the bug\n\nI am using the following configuration:\n\n```\ni18n: {\n locales: [ ... ],\n strategy: 'prefix_except_default',\n langDir: 'lang',\n lazy: true,\n defaultLocale: 'en',\n detectBrowserLanguage: {\n useCookie: true,\n cookieKey: 'i18n_redirected',\n fallbackLocale: 'en',\n redirectOn: 'no prefix',\n alwaysRedirect: true,\n }\n}\n```\n\nExpected:\nA Japanese user is on the link `https://www.xxx.com/ja/about`, now opening the following links should result in the following redirection behavior:\n`https://www.xxx.com/nl/about` → `https://www.xxx.com/nl/about`\n`https://www.xxx.com/about` → `https://www.xxx.com/ja/about`\n`https://www.xxx.com` → `https://www.xxx.com/ja`\n\nThis also matches the documentation:\n`'no prefix' - a more permissive variant of 'root' that will detect the browser locale on the root path ('/') and also on paths that have no locale prefix (like '/foo'). Only effective when using strategy other than 'no_prefix'.`\n\nActual behavior (only listing the problematic case):\n`https://www.xxx.com/nl/about` → `https://www.xxx.com/ja/about`\n\nThe above issue exists in versions v7, v8, and v9.\n\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell\n\n```",[3068,3071],{"name":3069,"color":3070},"scope: language detection","1B89B8",{"name":3072,"color":3073},"possible regression","B78041",3545,"closed","The behavior of redirectOn set to 'no prefix' from version 7 to version 9 is inconsistent with the documentation.","2025-06-22T23:03:38Z","https://github.com/nuxt-modules/i18n/issues/3545",0.6424259,{"description":3081,"labels":3082,"number":3092,"owner":3022,"repository":3023,"state":3075,"title":3093,"updated_at":3094,"url":3095,"score":3096},"### 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```",[3083,3086,3089],{"name":3084,"color":3085},"bug 🐛","ee0701",{"name":3087,"color":3088},"PR Welcome","40922A",{"name":3090,"color":3091},"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.6528722,{"description":3098,"labels":3099,"number":3101,"owner":3022,"repository":3023,"state":3075,"title":3102,"updated_at":3103,"url":3104,"score":3105},"### Environment\n\n------------------------------\n- Operating System: Linux\n- Node Version: v22.14.0\n- Nuxt Version: 3.17.2\n- CLI Version: 3.25.0\n- Nitro Version: 2.11.7\n- Package Manager: pnpm@10.6.5\n- Builder: -\n- User Config: -\n- Runtime Modules: -\n- Build Modules: -\n------------------------------\n\n### Reproduction\n\nI made a fork and modified the playground a bit. Start the playground and go to the `/jatest` page. You will see 404 screen, even though the page exists.\n\nhttps://github.com/MellKam/i18n/tree/v9\n\n### Describe the bug\n\nConsider the following config:\n\n```ts\nexport default defineNuxtConfig({\n modules: ['@nuxtjs/i18n'],\n i18n: {\n strategy: 'prefix_except_default',\n multiDomainLocales: true,\n locales: [\n {\n code: 'en',\n language: 'en-US',\n file: 'en.json',\n name: 'English',\n domains: ['localhost:3000']\n },\n {\n code: 'ja',\n language: 'ja-JP',\n file: 'ja.json',\n name: 'Japanese',\n domains: ['localhost:3000'],\n defaultForDomains: ['localhost:3000']\n }\n ]\n },\n compatibilityDate: '2025-02-04'\n})\n```\n\nThe default locale for domain localhost:3000 would be `ja`. The selected strategy is `prefix_except_default`, so prefix `ja` should be removed from path. \n\nBut let's consider the page path that looks like this: `/jatest`. When we try to go to this page we don't want the prefix to be removed as it's the part of the path and not the prefix of locale. But in `9.5.6` we would actually get 404 with message `Page /test not found`",[3100],{"name":3019,"color":3020},3715,"[v9] Default locale prefix incorrectly removed from route paths that start with locale substring (e.g. /jatest becomes /test)","2025-07-20T20:13:46Z","https://github.com/nuxt-modules/i18n/issues/3715",0.6556081,{"description":3107,"labels":3108,"number":3110,"owner":3022,"repository":3023,"state":3075,"title":3111,"updated_at":3112,"url":3113,"score":3114},"### Environment\n\n- Operating System: Linux\r\n- Node Version: v18.20.3\r\n- Nuxt Version: 3.12.4\r\n- CLI Version: 3.12.0\r\n- Nitro Version: -\r\n- Package Manager: pnpm@8.15.6\r\n- Builder: -\r\n- User Config: modules, runtimeConfig, i18n, compatibilityDate\r\n- Runtime Modules: @nuxtjs/i18n@8.3.1\r\n- Build Modules: -\n\n### Reproduction\n\nhttps://stackblitz.com/edit/nuxt-starter-i18n-timothe?file=app.vue,pages/%5B...slug%5D.vue,nuxt.config.ts\n\n### Describe the bug\n\nWhen using `prefix_except_default` strategy, and try to initialize locale with setLocale function but I18n fallback to default locale afterward. It's only work when I set detectBrowserLanguage to `{}` instead of `false`.\n\n### Additional context\n\nI let the CMS handle the routing for the wildcard.\n\n### Logs\n\n```shell\nisSSG false\r\nuseCookie on setup false\r\ndefaultLocale on setup fr\r\ngetLocaleCookie { useCookie: false, cookieKey: false, localeCodes: [ 'fr', 'en' ] }\r\ndetectLocale: initialLocale - fr\r\ndetectLocale: (ssg, callType, firstAccess) - normal setup true\r\ndetectLocale: detectBrowserLanguage (browserLocale, stat, reason, from) - false unknown unknown\r\ndetectLocale: finaleLocale first (finaleLocale, strategy) - prefix_except_default\r\ndetectLocale: finaleLocale second (finaleLocale, detectBrowserLanguage) - false\r\ndetectLocale: finalLocale last (finalLocale, defaultLocale) - fr\r\ndetectLocale: finalLocale - fr\r\nfirst detect initial locale fr\r\n../assets/fr.json is loading ...\r\nloadMessage: (locale) - fr\r\nloadMessage: load { welcome:\r\n { type: 0,\r\n start: 0,\r\n end: 9,\r\n loc: { start: [Object], end: [Object], source: 'Bienvenue' },\r\n body:\r\n { type: 2, start: 0, end: 9, loc: [Object], items: [Array], static: 'Bienvenue' } } }\r\nfinal initial locale: fr\r\nlocale-changing middleware { fullPath: '/',\r\n hash: '',\r\n query: {},\r\n name: 'slug',\r\n path: '/',\r\n params: { slug: '' },\r\n matched:\r\n [ { path: '/:slug(.*)*',\r\n redirect: undefined,\r\n name: 'slug',\r\n meta: {},\r\n aliasOf: undefined,\r\n beforeEnter: undefined,\r\n props: [Object],\r\n children: [],\r\n instances: {},\r\n leaveGuards: Set(0) {},\r\n updateGuards: Set(0) {},\r\n enterCallbacks: {},\r\n components: [Object] } ],\r\n meta: {},\r\n redirectedFrom: undefined,\r\n href: '/' } { fullPath: '/',\r\n path: '/',\r\n query: {},\r\n hash: '',\r\n name: undefined,\r\n params: { slug: '' },\r\n matched:\r\n [ { path: '/:slug(.*)*',\r\n redirect: undefined,\r\n name: 'slug',\r\n meta: {},\r\n aliasOf: undefined,\r\n beforeEnter: undefined,\r\n props: [Object],\r\n children: [],\r\n instances: {},\r\n leaveGuards: Set(0) {},\r\n updateGuards: Set(0) {},\r\n enterCallbacks: {},\r\n components: [Object] } ],\r\n meta: {},\r\n redirectedFrom: undefined,\r\n href: '/' }\r\ngetLocaleCookie { useCookie: false, cookieKey: false, localeCodes: [ 'fr', 'en' ] }\r\ndetectLocale: initialLocale - fr\r\ndetectLocale: (ssg, callType, firstAccess) - normal routing true\r\ndetectLocale: detectBrowserLanguage (browserLocale, stat, reason, from) - false unknown unknown\r\ndetectLocale: finaleLocale first (finaleLocale, strategy) - prefix_except_default\r\ndetectLocale: finaleLocale second (finaleLocale, detectBrowserLanguage) - false\r\ndetectLocale: finalLocale last (finalLocale, defaultLocale) - fr\r\ndetectLocale: finalLocale - fr\r\ndetect locale fr\r\nlocaleSetup false\r\nsetLocale: new -> fr old -> fr initial -> false\r\ndetectRedirect: targetLocale -> fr\r\ndetectRedirect: route -> { to:\r\n { fullPath: '/',\r\n hash: '',\r\n query: {},\r\n name: 'slug',\r\n path: '/',\r\n params: { slug: '' },\r\n matched: [ [Object] ],\r\n meta: {},\r\n redirectedFrom: undefined,\r\n href: '/' },\r\n from:\r\n { fullPath: '/',\r\n path: '/',\r\n query: {},\r\n hash: '',\r\n name: undefined,\r\n params: { slug: '' },\r\n matched: [ [Object] ],\r\n meta: {},\r\n redirectedFrom: undefined,\r\n href: '/' } }\r\ndetectRedirect: calledWithRouting -> true \r\ndetectRedirect: calculate routePath -> /\r\nredirectPath on locale-changing middleware \r\nnavigate options 302 false false false\r\nnavigate isSSG false\r\nsetLocale: new -> en old -> fr initial -> true\r\n../assets/en.json is loading ...\r\nloadMessage: (locale) - en\r\nloadMessage: load { welcome:\r\n { type: 0,\r\n start: 0,\r\n end: 7,\r\n loc: { start: [Object], end: [Object], source: 'Welcome' },\r\n body: { type: 2, start: 0, end: 7, loc: [Object], items: [Array], static: 'Welcome' } } }\r\ndetectRedirect: targetLocale -> en\r\ndetectRedirect: route -> { to: {} }\r\ndetectRedirect: calledWithRouting -> false \r\ndetectRedirect: calculate routePath -> /\r\nredirectPath on setLocale \r\nnavigate options 302 false false true\r\nnavigate isSSG false\n```\n",[3109],{"name":3069,"color":3070},3039,"DetectBrowserLanguage rollback to default locale when using `prefix_except_default`","2025-06-08T01:03:16Z","https://github.com/nuxt-modules/i18n/issues/3039",0.65766245,{"description":3116,"labels":3117,"number":3121,"owner":3022,"repository":3023,"state":3075,"title":3122,"updated_at":3123,"url":3124,"score":3125},"## Bug Report\n\n### Description\nWhen using `strategy: 'prefix'`, the i18n module doesn't respect the URL prefix language when the browser sends an `accept-language` header.\n\n### Expected Behavior\nWhen accessing `/zh` path, the page should display in Chinese (zh) regardless of the `accept-language` header value.\n\n### Actual Behavior\nWhen accessing `/zh` path with `accept-language: en;zh-ch,q=0.9;kr,q=0.8`, the page displays in English (en) instead of Chinese (zh).\n\n### Configuration\n```typescript\n// nuxt.config.ts\nexport default defineNuxtConfig({\n modules: ['@nuxtjs/i18n'],\n i18n: {\n strategy: 'prefix',\n locales: [\n { code: 'zh', name: '中文' },\n { code: 'en', name: 'English' },\n { code: 'ja', name: '日本語' },\n { code: 'ko', name: '한국어' }\n ],\n defaultLocale: 'zh',\n detectBrowserLanguage: {\n useCookie: true,\n cookieKey: 'i18n_redirected',\n redirectOn: 'root'\n }\n }\n})\n```\n\n### Reproduction Steps\n1. Set up Nuxt project with above i18n configuration\n2. Create a simple page with locale-specific content\n3. Make request to `/zh` with specific accept-language header\n\n### cURL Example\n```bash\ncurl -H \"Accept-Language: en;zh-ch,q=0.9;kr,q=0.8\" http://localhost:3000/zh\n```\n\n### Expected Result\nPage should display in Chinese (zh) as specified by the URL prefix `/zh`.\n\n### Actual Result\nPage displays in English (en) as specified by the accept-language header priority.\n\n### Environment\n- Nuxt version: v4.0\n- @nuxtjs/i18n version: v10.0.2",[3118],{"name":3119,"color":3120},"need reproduction","CD234A",3752,"Bug: strategy 'prefix' doesn't respect URL prefix when accept-language header is present","2025-07-23T10:21:05Z","https://github.com/nuxt-modules/i18n/issues/3752",0.66166234,["Reactive",3127],{},["Set"],["ShallowReactive",3130],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fzhfixdctxLaW26y_d2wUmhCtiGqgzoiHePmLurTh-ic":-1},"/nuxt-modules/i18n/3619"]