nuxt-modules / i18n

I18n module for Nuxt
https://i18n.nuxtjs.org
MIT License
1.65k stars 465 forks source link

Multi-Domain Website configuration with partial shared domains #2979

Open silgon opened 2 weeks ago

silgon commented 2 weeks ago

Discussed in https://github.com/nuxt-modules/i18n/discussions/2958

Originally posted by **silgon** May 26, 2024 I'm trying to build a multi-domain website. However, I want part of the languages to be on one site. I would like something like the following: ```typescript export default defineNuxtConfig({ // ... i18n: { locales: [ { code: 'en-US', domain: 'mydomain.com' }, { code: 'es-MX', domain: 'mydomain.com/es-MX' }, { code: 'ch-DE', domain: 'another-domain.ch'. }, { code: 'ch-FR', domain: 'another-domain.ch/ch-FR' }, ], differentDomains: true // Or enable the option in production only // differentDomains: (process.env.NODE_ENV === 'production') }, // ... }) ``` I hope that it's clear what I want to do given the configuration. My guidelines where the following link https://v8.i18n.nuxtjs.org/guide/different-domains Could somebody give me some guidance? I'm not able to do what I want. (also some insights in the sitemap with that kind of configuration would be cool, but not sure if this is the right place) When I'm in the same domain, the language does not change (I use the href configuration as specified in the documentation)