|\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).",[2898],{"name":2899,"color":2900},"pending triage","c2e0c6",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.7594911,{"description":2907,"labels":2908,"number":2910,"owner":2880,"repository":2881,"state":2882,"title":2911,"updated_at":2912,"url":2913,"score":2914},"### 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```",[2909],{"name":2899,"color":2900},3598,"defineI18nRoute is not working with no_prefix strategy","2025-05-13T14:21:14Z","https://github.com/nuxt-modules/i18n/issues/3598",0.76361793,{"description":2916,"labels":2917,"number":2919,"owner":2880,"repository":2881,"state":2882,"title":2920,"updated_at":2921,"url":2922,"score":2923},"### 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).",[2918],{"name":2899,"color":2900},3593,"Support for file prefix in locales.files config","2025-05-11T07:15:31Z","https://github.com/nuxt-modules/i18n/issues/3593",0.76567775,{"description":2925,"labels":2926,"number":2928,"owner":2880,"repository":2881,"state":2882,"title":2929,"updated_at":2930,"url":2931,"score":2932},"### Environment\n\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: yarn@1.22.22\n- Builder: -\n- User Config: devtools, nitro, router, app, runtimeConfig, components, modules, intercom, build, sentry, sourcemap, i18n, tailwindcss, site, vite, sitemap\n- Runtime Modules: @sentry/nuxt/module@9.14.0, @nuxtjs/i18n@9.5.4, @nuxtjs/tailwindcss@6.13.2, @nuxtjs/sitemap@7.2.10, nuxt-3-intercom@1.1.2\n- Build Modules: -\n------------------------------\n\n### Reproduction\n\nN/A\n\n### Describe the bug\n\nCurrently we have setup some redirects using nitro RouteRules.\nFor example:\n\n```\n'/test' = { redirect: {to: '/foo/test', code: 301 }, prerender: false }\n```\n\nAt the same time we have disabled the prerender option.\n\nWhen we run `nuxt build` we get 404 error for above redirects.\nIf we disable the redirect routeRules everything works as expected.\n\nNot sure what i18n module does to redirects urls but it crashes the build process.\n\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell\n\n```",[2927],{"name":2899,"color":2900},3606,"issue with nitro routeRules and redirect","2025-05-16T11:05:04Z","https://github.com/nuxt-modules/i18n/issues/3606",0.76696223,{"description":2934,"labels":2935,"number":2943,"owner":2880,"repository":2881,"state":2944,"title":2945,"updated_at":2946,"url":2947,"score":2948},"### 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_",[2936,2939,2940],{"name":2937,"color":2938},"🍰 p2-nice-to-have","0e8a16",{"name":2877,"color":2878},{"name":2941,"color":2942},"PR Welcome","40922A",2033,"closed","Custom routes issue with switchLocalePath","2025-05-22T23:35:14Z","https://github.com/nuxt-modules/i18n/issues/2033",0.66525507,{"description":2950,"labels":2951,"number":2958,"owner":2880,"repository":2881,"state":2944,"title":2959,"updated_at":2960,"url":2961,"score":2962},"### Describe the feature\n\nWe already have [`getRouteBaseName()`](https://v8.i18n.nuxtjs.org/api/vue#getroutebasename) to get the base name of current (or given) route.\r\nIt would be useful if we have a similar `getRouteBase(localizedRoute?: Route | RouteLocationNormalizedLoaded)` function to un-localize a route.\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://v3.nuxtjs.org/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/framework/issues).",[2952,2955],{"name":2953,"color":2954},"feature request","ffbb00",{"name":2956,"color":2957},"need discussion","E9EC2E",1897,"Expose a way to get a route base","2025-05-23T13:48:11Z","https://github.com/nuxt-modules/i18n/issues/1897",0.7127924,{"description":2964,"labels":2965,"number":2968,"owner":2880,"repository":2881,"state":2944,"title":2969,"updated_at":2970,"url":2971,"score":2972},"### Environment\n\n\"@nuxtjs/i18n\": \"^9.0.0\",\n\"nuxt\": \"^3.17.2\"\n\n### Reproduction\n\nsry, it is private, cant provide\n\n### Describe the bug\n\nI want to use Routing Strategies configuration, and I want to configure it to jump to the corresponding 404 page if the route is not found. I haven't found the setting document for this.\n\nif i use router.options.ts, the Routing Strategies configuration will be not work.\n\nthis is the router.options.ts code:\n```\nimport type { RouterConfig } from '@nuxt/schema'\n\nexport default \u003CRouterConfig>{\n routes: (_routes: any) => {\n return [\n {\n name: '404',\n path: '/404/',\n component: () => import('../pages/404.vue')\n },\n {\n path: '/',\n name: 'Home',\n component: () => import('../pages/index.vue')\n },\n {\n path: '/:pathMatch(.*)',\n redirect: '/404/'\n }\n ]\n }\n}\n```\nit is my i18n configuration: \n```\n i18n: {\n strategy: 'prefix_except_default',\n locales: [\n { code: \"zh-CN\", name: \"简体中文\", file: \"zh-CN.json\" },\n { code: \"zh-TW\", name: \"繁體中文\", file: \"zh-TW.json\" },\n { code: \"en\", name: \"English\", file: \"en.json\" },\n ],\n defaultLocale: 'en',\n trailingSlash: true,\n experimental: {\n switchLocalePathLinkSSR: true\n }\n }\n```\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell\n\n```",[2966,2967],{"name":2899,"color":2900},{"name":2877,"color":2878},3597,"The strategy parameter and router.options.ts configuration cannot be used together","2025-05-23T08:03:30Z","https://github.com/nuxt-modules/i18n/issues/3597",0.7157212,{"description":2974,"labels":2975,"number":2979,"owner":2880,"repository":2881,"state":2944,"title":2980,"updated_at":2981,"url":2982,"score":2983},"### Environment\n\n- Operating System: `Windows_NT`\n- Node Version: `v22.14.0`\n- Nuxt Version: `3.16.2`\n- CLI Version: `3.24.0`\n- Nitro Version: `2.11.8`\n- Package Manager: `npm@10.8.1`\n- Builder: `-`\n- User Config: `modules`, `imports`, `devtools`, `app`, `css`, `site`, `runtimeConfig`, `devServer`, `experimental`, `compatibilityDate`, `nitro`, `vite`, `typescript`, `eslint`, `graphqlMiddleware`, `i18n`, `image`, `leaflet`, `multiCache`, `primevue`\n- Runtime Modules: `@pinia/nuxt@0.10.1`, `pinia-plugin-persistedstate/nuxt@4.2.0`, `nuxt-multi-cache@3.4.0`, `nuxt-graphql-middleware@4.3.2`, `normalizedModule()`, `@nuxtjs/i18n@9.4.0`, `@nuxtjs/seo@3.0.1`, `@nuxtjs/leaflet@1.2.6`, `nuxt-splide@1.1.1`, `@nuxt/icon@1.11.0`, `@primevue/nuxt-module@4.3.2`, `@nuxt/image@1.10.0`, `@formkit/auto-animate/nuxt@0.8.2`, `@vueuse/nuxt@13.0.0`, `nuxt-lodash@2.5.3`, `nuxt-monaco-editor@1.3.1`, `dayjs-nuxt@2.1.11`, `@nuxt/eslint@1.2.0`\n- Build Modules: `-`\n\n\n### Reproduction\n\n1. Create a new Nuxt 3 project and install @nuxtjs/i18n. Configure the module as needed.\n\n2. Create the following folder structure within the pages directory:\n\n```\npages/\n└── blog/\n├── [[category]]/\n│ ├── [article].html.vue\n│ └── index.vue\n└── index.vue\n```\n\n3. Add a basic HTML template to each of the .vue files for visual identification. For example:\n\npages/blog/index.vue:\n```html\n\u003Ctemplate>\n\n\u003Cdiv>Blog Index (root)\u003C/div>\n\u003C/template>\n```\npages/blog/[[category]]/index.vue:\n```html\n\u003Ctemplate>\n\n\u003Cdiv>Category Index: {{ $route.params.category }}\u003C/div>\n\u003C/template>\n```\npages/blog/[[category]]/[[article]].html.vue:\n```html\n\u003Ctemplate>\n\n\u003Cdiv>Article: {{ $route.params.article }} in Category: {{ $route.params.category }}\u003C/div>\n\u003C/template>\n```\n4. Run Nuxt in development mode (npm run dev or yarn dev or pnpm dev).\n\n5. Navigate to the following URLs in your browser:\n\n - /blog/ - Expected to render \"Blog Index (root)\" (Works as expected).\n \n - /blog/article2.html - Expected to render [article].html.vue with category as undefined and article as article2. Current Behavior: Instead, it seems to attempt to render [[category]]/index.vue, possibly interpreting \"article2.html\" as the category parameter, leading to unexpected output or a 404.\n \n - /blog/category1/ - Expected to render \"Category Index: category1\" (Works as expected).\n \n - /blog/category1/article1.html - Expected to render \"Article: article1 in Category: category1\" (Works as expected).\n\n\nMinimal reproduction:\nhttps://stackblitz.com/edit/github-wp13roib-mzypd8gg\n\n### Describe the bug\n\nWith @nuxtjs/i18n enabled, accessing a dynamic route [[article]].html.vue within a directory with an optional dynamic parameter [[category]] directly with the .html extension results in incorrect route resolution. Instead of correctly identifying the optional category parameter as missing and resolving to the [article].html.vue route, Nuxt seems to be trying to match the URL against the [[category]]/index.vue route, misinterpreting the \"article2.html\" segment.\n\n### Additional context\n\nThis issue only occurs when @nuxtjs/i18n is active. Without the module, a different routing issue arises (documented in the next issue). This suggests an interaction between the Nuxt routing and @nuxtjs/i18n in handling optional dynamic parameters with file extensions.\n\n\n\n### Logs\n\n```shell\n\n```",[2976],{"name":2977,"color":2978},"upstream issue","fbca04",3504,"Dynamic route with optional parent parameter fails to resolve correctly when accessed directly with extension","2025-05-22T15:54:36Z","https://github.com/nuxt-modules/i18n/issues/3504",0.72567475,["Reactive",2985],{},["Set"],["ShallowReactive",2988],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fSXc1IkqzGJ3C_ar2gzUMUJqAeCEdemQbRM9C8SgrYUM":-1},"/nuxt-modules/i18n/2407"]