nuxt-modules / i18n

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

feat: add support for multi domain locales #3065

Closed DotwoodMedia closed 3 months ago

DotwoodMedia commented 3 months ago

๐Ÿ”— Linked issue

Different domains with multiple languages each #1161

โ“ Type of change

๐Ÿ“š Description

Resolves https://github.com/nuxt-modules/i18n/issues/1161 by allowing the same locale on multiple domains.

NL domain:
https://mydomain.nl/ -> https://mydomain.nl/ (nl language)
https://mydomain.nl/en -> https://mydomain.nl/en (en language)
https://mydomain.nl/de -> https://mydomain.nl/de (de language)

https://mydomain.nl/nl -> https://mydomain.nl/nl (404)

DE domain:
https://mydomain.de/ -> https://mydomain.nl/ (nl language)
https://mydomain.de/en -> https://mydomain.nl/en (en language)
https://mydomain.de/nl -> https://mydomain.nl/de (de language)

https://mydomain.de/de -> https://mydomain.de/de (404)

๐Ÿ“ Checklist

๐Ÿ—’๏ธ Note

The developers of @socialdeal (@vincentdevreede, @dotwoodmedia & @DarthGigi) has rebuilt the feature from https://github.com/nuxt-modules/i18n/pull/2914 due to excessive bugs.

BobbieGoede commented 3 months ago

Thanks! Can you target the main branch instead of v8 for this PR? We will merge compatible changes back into the v8 branch, we want this to be included in v9 too of course. The docs for v9 will need to be updated in the same way (in the v9 dir).

DotwoodMedia commented 3 months ago

@BobbieGoede we updated the branch/pr to the main branch (V9) :)

BobbieGoede commented 3 months ago

Thanks again! This looks good and doesn't seem to conflict with existing functionality, I'll see if I can merge and publish a new minor release for v8 soon.

For v9 we may do some refactoring and possibly change the way this functionality is configured, I think there's still some undefined behavior when multiple layers use the new locale options, and not sure what the desired merging behavior would be.