|\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).",[2870],{"name":2857,"color":2858},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.68500054,{"description":2877,"labels":2878,"number":2880,"owner":2860,"repository":2861,"state":2862,"title":2881,"updated_at":2882,"url":2883,"score":2884},"### 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```",[2879],{"name":2857,"color":2858},3598,"defineI18nRoute is not working with no_prefix strategy","2025-05-13T14:21:14Z","https://github.com/nuxt-modules/i18n/issues/3598",0.6932793,{"description":2886,"labels":2887,"number":2889,"owner":2860,"repository":2861,"state":2862,"title":2890,"updated_at":2891,"url":2892,"score":2893},"### Environment\n\n------------------------------\n- Operating System: Windows_NT\n- Node Version: v19.9.0\n- Nuxt Version: 3.17.3\n- CLI Version: 3.25.1\n- Nitro Version: 2.11.12\n- Package Manager: npm@9.6.3\n- Builder: -\n- User Config: modules, i18n, tailwindcss, css, plugins, devtools, compatibilityDate, runtimeConfig, vite, nitro\n- Runtime Modules: @geeks.solutions/nuxt-sections@3.0.1, @nuxt/image@1.10.0, @nuxtjs/i18n@9.5.4, @nuxtjs/tailwindcss@6.14.0, nuxt-lazytube@0.2.2, nuxt3-leaflet@1.0.13, @pinia/nuxt@0.11.0\n- Build Modules: -\n------------------------------\n\n\n### Reproduction\n\n* nuxt.config.ts\n\n```ts\nexport default defineNuxtConfig({\n ...(process.env.NODE_ENV === 'development' && {\n devServer: {\n https: {},\n host: '0.0.0.0',\n port: 443,\n }\n }),\n modules: [\n \"@geeks.solutions/nuxt-sections\",\n \"@nuxt/image\",\n \"@nuxtjs/i18n\",\n \"@nuxtjs/tailwindcss\",\n \"nuxt-lazytube\",\n \"nuxt3-leaflet\",\n \"@pinia/nuxt\"\n ],\n i18n: {\n detectBrowserLanguage: false,\n defaultLocale: \"en\",\n locales: [\n {\n name: \"French\",\n code: \"fr\",\n iso: \"fr\",\n file: \"fr.js\"\n },\n {\n name: \"English\",\n code: \"en\",\n iso: \"en\",\n file: \"en.js\"\n }\n ],\n langDir: \"lang/\",\n experimental: {\n localeDetector: 'localeDetector.ts'\n }\n },\n tailwindcss: {\n\n },\n css: [\n '~/assets/css/default.css'\n ],\n plugins: [\n '~/plugins/vue-dragscroll.js'\n ],\n devtools: { enabled: true },\n compatibilityDate: '2025-05-13',\n vite: {\n optimizeDeps: {\n include: ['quill', '@devdcodes9/quill-emojijs', 'quill-table-ui'],\n }\n },\n nitro: {\n compressPublicAssets: {\n gzip: true,\n brotli: true\n }\n }\n})\n```\n\n* localeDetector.ts inside i18n directory\n\n```ts\nconsole.log(\"Detector file loaded\")\n\n// Detect based on query, cookie, header\nexport default defineI18nLocaleDetector((event, config) => {\n\n console.log(\"Event\", event)\n\n // try to get locale from query\n const query = tryQueryLocale(event, { lang: '' }) // disable locale default value with `lang` option\n if (query) {\n return query.toString()\n }\n\n // try to get locale from cookie\n const cookie = tryCookieLocale(event, { lang: '', name: 'i18n_redirected' }) // disable locale default value with `lang` option\n if (cookie) {\n return cookie.toString()\n }\n\n // try to get locale from header (`accept-header`)\n const header = tryHeaderLocale(event, { lang: '' }) // disable locale default value with `lang` option\n if (header) {\n return header.toString()\n }\n\n // If the locale cannot be resolved up to this point, it is resolved with the value `defaultLocale` of the locale config passed to the function\n return config.defaultLocale\n})\n```\n\n* nuxi prepare\n* nuxi dev\n\n### Describe the bug\n\nI am trying to use the experimental localeDetector feature.\nThe localeDetector file is loaded and confirmed by having `Detector file loaded` logged on the server console.\n\nThe problem I am facing is that defineI18nLocaleDetector is never called and no Event is logged.\nAm I missing something ?\n\n### Additional context\n\nIn the documentation I saw that the local detector function is called per request on the server, so why the code inside the defineI18nLocaleDetector is never reached\n\n### Logs\n\n```shell\nNo errors logged at all\n```",[2888],{"name":2857,"color":2858},3651,"Code inside defineI18nLocaleDetector is not reached","2025-05-29T06:34:13Z","https://github.com/nuxt-modules/i18n/issues/3651",0.70732766,{"description":2895,"labels":2896,"number":2898,"owner":2860,"repository":2861,"state":2862,"title":2899,"updated_at":2900,"url":2901,"score":2902},"### 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).",[2897],{"name":2857,"color":2858},3593,"Support for file prefix in locales.files config","2025-05-11T07:15:31Z","https://github.com/nuxt-modules/i18n/issues/3593",0.717804,{"description":2904,"labels":2905,"number":2907,"owner":2860,"repository":2861,"state":2908,"title":2909,"updated_at":2910,"url":2911,"score":2912},"### 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```",[2906],{"name":2857,"color":2858},3631,"closed","Respect NuxtLink props, just like NuxtLink respects VueRouteLink!","2025-05-22T11:29:36Z","https://github.com/nuxt-modules/i18n/issues/3631",0.64340913,{"description":2914,"labels":2915,"number":2919,"owner":2860,"repository":2861,"state":2908,"title":2920,"updated_at":2921,"url":2922,"score":2923},"### 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_",[2916],{"name":2917,"color":2918},"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.65452397,{"description":2925,"labels":2926,"number":2930,"owner":2860,"repository":2861,"state":2908,"title":2931,"updated_at":2932,"url":2933,"score":2934},"### 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_",[2927],{"name":2928,"color":2929},"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.67194426,{"description":2936,"labels":2937,"number":2944,"owner":2860,"repository":2861,"state":2908,"title":2945,"updated_at":2946,"url":2947,"score":2948},"### 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```",[2938,2941],{"name":2939,"color":2940},"bug 🐛","ee0701",{"name":2942,"color":2943},"domain","fbca04",3628,"`switchLocalePath` should include the baseURL","2025-05-22T15:50:22Z","https://github.com/nuxt-modules/i18n/issues/3628",0.6777743,{"description":2950,"labels":2951,"number":2958,"owner":2860,"repository":2861,"state":2908,"title":2959,"updated_at":2960,"url":2961,"score":2962},"### 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```",[2952,2955],{"name":2953,"color":2954},"🍰 p2-nice-to-have","0e8a16",{"name":2956,"color":2957},"scope: components","B327C3",3402,"Double nested `NuxtLinkLocale`","2025-05-30T19:25:27Z","https://github.com/nuxt-modules/i18n/issues/3402",0.686452,["Reactive",2964],{},["Set"],["ShallowReactive",2967],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fEr-ou8uxSshoj0lQ9Eu0IVCfg3E8bay7u0gLKU1BmXU":-1},"/nuxt-modules/i18n/3252"]