|\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).",[2911],{"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.72378826,{"description":2918,"labels":2919,"number":2923,"owner":2871,"repository":2872,"state":2873,"title":2924,"updated_at":2925,"url":2926,"score":2927},"## Updates\n\n- 2024/01/02: Updated reproduction and steps to reproduce at https://github.com/nuxt-modules/i18n/issues/2524#issuecomment-1873823456\n- 2025/05/02: Updated reproduction for v9.5.4: https://github.com/nuxt-modules/i18n/issues/2524#issuecomment-2847024120\n\n## Original post\n\n### Environment\n\nWorking directory: /home/projects/aoniwxvlm.github 13:55:30\nNuxt project info: 13:55:30\n\n------------------------------\n- Operating System: Linux\n- Node Version: v18.18.0\n- Nuxt Version: 3.8.0\n- CLI Version: 3.9.1\n- Nitro Version: 2.7.0\n- Package Manager: npm@9.4.2\n- Builder: -\n- User Config: devtools, modules, i18n\n- Runtime Modules: @nuxtjs/i18n@8.0.0-rc.5\n- Build Modules: -\n------------------------------\n\n### Reproduction\n\nhttps://stackblitz.com/edit/github-fyaxh8\n\n### Describe the bug\n\nThe root redirect takes the `Accept-Language` header into account:\n\n```\ncurl -H \"Accept-Language: fr\" -I http://localhost:3000\n```\n\n```\nHTTP/1.1 302 Found\naccess-control-allow-origin: *\nlocation: /fr\ncontent-type: text/html\ndate: Wed, 25 Oct 2023 11:49:52 GMT\nconnection: close\n```\n\nBut everything else does not:\n\n```\ncurl -H \"Accept-Language: fr\" -I http://localhost:3000/foo\n```\n\n```\nHTTP/1.1 302 Found\naccess-control-allow-origin: *\nlocation: /en/foo\ncontent-type: text/html\ndate: Wed, 25 Oct 2023 11:49:41 GMT\nconnection: close\n```\n\nThis also relates to #2131 because I'm using the `prefix` strategy, which means I should actually get a 404 on the `/foo` request. Therefore, I think fixing #2131 will also fix this issue, but not vice versa.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[2920],{"name":2921,"color":2922},"browser language detection","c5def5",2524,"Inconsistent handling of `Accept-Language` header","2025-05-02T11:49:20Z","https://github.com/nuxt-modules/i18n/issues/2524",0.732873,{"description":2929,"labels":2930,"number":2932,"owner":2871,"repository":2872,"state":2873,"title":2933,"updated_at":2934,"url":2935,"score":2936},"### Environment\n\n\nSuch as in the reproduction.\n\n\n\n### Reproduction\n\nhttps://stackblitz.com/edit/bobbiegoede-nuxt-i18n-starter-kvjaukgj?file=nuxt.config.ts\n\n### Describe the bug\n\nPreviously I was using an older version of the module, there 'npm generate' created an index.html with a redirect to the default language. \n`npx serve .output/public` now displays only folder structure. You can only enter manually by adding /en in the link.\n\nI couldn't find any information about this change in the documentation and on the nuxt help channel.\n\n\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell\n\n```",[2931],{"name":2868,"color":2869},3624,"Missing generated index.html in root folder on “prefix” mode. SSG","2025-05-20T12:46:00Z","https://github.com/nuxt-modules/i18n/issues/3624",0.73891073,{"description":2938,"labels":2939,"number":2941,"owner":2871,"repository":2872,"state":2942,"title":2943,"updated_at":2944,"url":2945,"score":2946},"### Environment\n\n------------------------------\n- Operating System: Linux\n- Node Version: v23.11.1\n- Nuxt Version: 3.17.4\n- CLI Version: 3.25.1\n- Nitro Version: 2.11.12\n- Package Manager: npm@11.4.0\n- Builder: -\n- User Config: compatibilityDate, devtools, modules, i18n, devServer\n- Runtime Modules: @nuxtjs/i18n@9.5.5\n- Build Modules: -\n------------------------------\n\n### Reproduction\n\nMinimal repo here https://github.com/ThibaudDauce/test_i18n\n\nThis is my `app.vue`:\n```html\n\u003Ctemplate>\n \u003Cdiv>\n \u003Cp>{{ $t('Hello {name}', { name: 'John' }) }}\u003C/p>\n \u003Cp>{{ $t('The weather today is {condition}!', { condition: 'sunny' }) }}\u003C/p>\n \u003C/div>\n\u003C/template>\n```\n\nWith this `i18n/i18n.config.ts`:\n```ts\nexport default defineI18nConfig(() => {\n return {\n missingWarn: false,\n formatFallbackMessages: true,\n }\n})\n```\n\nAnd this `nuxt.config.ts`:\n```ts\nexport default defineNuxtConfig({\n compatibilityDate: '2025-05-15',\n devtools: { enabled: true },\n modules: ['@nuxtjs/i18n'],\n i18n: {\n defaultLocale: 'fr',\n },\n devServer: {\n port: 8080,\n },\n})\n```\n\n`missingWarn: false` is working so the config seems to be loaded correctly.\n\n### Describe the bug\n\nWhen I set `formatFallbackMessages: true`, the messages are not formatted in the template.\n",[2940],{"name":2868,"color":2869},3670,"closed","Cannot set `formatFallbackMessages`","2025-06-02T13:58:58Z","https://github.com/nuxt-modules/i18n/issues/3670",0.65914804,{"description":2948,"labels":2949,"number":2956,"owner":2871,"repository":2872,"state":2942,"title":2957,"updated_at":2958,"url":2959,"score":2960},"### Environment\r\n\r\n------------------------------\r\n- Operating System: `Darwin`\r\n- Node Version: `v16.14.0`\r\n- Nuxt Version: `3.0.0`\r\n- Nitro Version: `1.0.0`\r\n- Package Manager: `yarn@1.22.19`\r\n- Builder: `vite`\r\n- User Config: `srcDir`, `ssr`, `modules`, `i18n`, `piniaPersistedstate`, `googleFonts`, `colorMode`, `postcss`, `build`, `vite`\r\n- Runtime Modules: `@nuxtjs/i18n@8.0.0-beta.7`, `@nuxtjs/tailwindcss@6.2.0`, `@nuxtjs/color-mode@3.2.0`, `@nuxtjs/google-fonts@3.0.0-1`, `@pinia/nuxt@0.4.6`, `@pinia-plugin-persistedstate/nuxt@1.0.0`, `@vueuse/nuxt@9.9.0`\r\n- Build Modules: `-`\r\n------------------------------\r\n\r\n### Reproduction\r\n\r\nUse this config:\r\n```\r\ni18n: {\r\n strategy: 'prefix_except_default',\r\n defaultLocale: 'fr',\r\n langDir: 'i18n/',\r\n locales: [\r\n {\r\n code: 'fr',\r\n name: 'Français',\r\n iso: 'fr-CA',\r\n momentLocale: 'fr-ca',\r\n },\r\n {\r\n code: 'en',\r\n name: 'English',\r\n iso: 'en-CA',\r\n file: 'en.json',\r\n momentLocale: 'en',\r\n },\r\n ],\r\n vueI18n: {\r\n legacy: false,\r\n fallbackWarn: false,\r\n missingWarn: false,\r\n formatFallbackMessages: true,\r\n },\r\n},\r\n```\r\n\r\n### Describe the bug\r\n\r\nIf I use fallback interpolation `formatFallbackMessages`, which mean instead of using `keys`, the `message` is the `key`.\r\nSo instead of `$('some.key.to.translate')` and I use `$t('Some key to translate.')`.\r\nThis work but I have one issue, I have an error if I don't define the `file` in `nuxt.config.ts` for that locale, but since the message are in the key, you don't need a file ! For now I created a file with an empty Object and it work, but it seem odd.\r\n\r\n\r\n\r\n### Additional context\r\n\r\n> Cannot restart nuxt: [@nuxtjs/i18n]: All locales must be objects and have the \"file\" property set when using \"langDir\".\r\nFound none in:\r\n```\r\n{\r\n \"code\": \"fr\",\r\n \"name\": \"Français\",\r\n \"iso\": \"fr-CA\",\r\n \"momentLocale\": \"fr-ca\"\r\n}\r\n```\r\n\r\n### Logs\r\n\r\n_No response_",[2950,2953],{"name":2951,"color":2952},"need more info","e295d6",{"name":2954,"color":2955},"upstream","fbca04",1784,"Fallback Interpolation `formatFallbackMessages` still require to define a `file: fr.json` even if not needed","2025-05-25T10:54:18Z","https://github.com/nuxt-modules/i18n/issues/1784",0.67168283,{"description":2962,"labels":2963,"number":2970,"owner":2871,"repository":2872,"state":2942,"title":2971,"updated_at":2972,"url":2973,"score":2974},"Spent 30 minutes trying to figure out why the fallback locale doesn't work\n\nhttps://i18n.nuxtjs.org/docs/guide/locale-fallback\n\nThe path of that file should be i18n/18n.config.ts, not in the root project directory (where other .config.ts files are)",[2964,2967],{"name":2965,"color":2966},"good first issue","7057ff",{"name":2968,"color":2969},"docs","33aa3f",3571,"docs: clarify that i18n.config.ts should be in i18n folder","2025-05-06T13:20:35Z","https://github.com/nuxt-modules/i18n/issues/3571",0.68528026,["Reactive",2976],{},["Set"],["ShallowReactive",2979],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fMekXsFrV6Mv_KdsYj-a54AN0G6rM5Lz0WVVX6EghS98":-1},"/nuxt-modules/i18n/3596"]