Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for multi domain locales #3065

Merged
merged 26 commits into from
Aug 19, 2024

Conversation

DotwoodMedia
Copy link
Contributor

🔗 Linked issue

Different domains with multiple languages each #1161

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Resolves #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

  • I have linked an issue or discussion.
  • I have added tests (if possible).
  • I have updated the documentation accordingly.

🗒️ Note

The developers of @socialdeal (@Vincentdevreede, @DotwoodMedia & @DarthGigi) has rebuilt the feature from #2914 due to excessive bugs.

danielroe and others added 20 commits July 26, 2024 11:25
* feat: i18n dir resolve

* feat: i18n dir resolve

* test: add restructure test

* refactor: file resolution

* fix: layer option validation

* docs: describe breaking folder structure change

* fix: layer validation

* chore: update lockfile

* test: change fixture structure

* feat: `restructureDir` option

* docs: describe restructure and compatible option
* fix: rename locale property `iso` to `language`

* refactor: rename parameters

* fix: locale `language` merging

* docs: expand `iso` rename explanation
…les#3061)

* fix: route localization with `differentDomains`

* fix: prevent route removal

* fix: `switchLocalePath` resolution for `differentDomains`

* docs: update notes to clarify `differentDomains` case
…es per domain

Developed by: Social Deal (@socialdeal)

Co-authored-by: Vincent de Vreede <[email protected]>
Co-authored-by: DarthGigi <[email protected]>
Developed by: Social Deal (@socialdeal)

Co-authored-by: Vincent de Vreede <[email protected]>
Co-authored-by: DarthGigi <[email protected]>
Developed by: Social Deal (@socialdeal)

Co-authored-by: Vincent de Vreede <[email protected]>
Co-authored-by: DarthGigi <[email protected]>
…trategies

Developed by: Social Deal (@socialdeal)

Co-authored-by: Vincent de Vreede <[email protected]>
Co-authored-by: DarthGigi <[email protected]>
DotwoodMedia and others added 2 commits August 19, 2024 11:23
Developed by: Social Deal (@socialdeal)

Co-authored-by: Vincent de Vreede <[email protected]>
Co-authored-by: DarthGigi <[email protected]>
Developed by: Social Deal (@socialdeal)

Co-authored-by: Vincent de Vreede <[email protected]>
Co-authored-by: DarthGigi <[email protected]>
@BobbieGoede
Copy link
Collaborator

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 and others added 2 commits August 19, 2024 11:41
Developed by: Social Deal (@socialdeal)

Co-authored-by: Vincent de Vreede <[email protected]>
Co-authored-by: DarthGigi <[email protected]>
@DotwoodMedia DotwoodMedia changed the base branch from v8 to main August 19, 2024 09:42
DotwoodMedia and others added 2 commits August 19, 2024 11:45
Developed by: Social Deal (@socialdeal)

Co-authored-by: Vincent de Vreede <[email protected]>
Co-authored-by: DarthGigi <[email protected]>
Developed by: Social Deal (@socialdeal)

Co-authored-by: Vincent de Vreede <[email protected]>
Co-authored-by: DarthGigi <[email protected]>
@DotwoodMedia
Copy link
Contributor Author

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

@BobbieGoede BobbieGoede merged commit 8891600 into nuxt-modules:main Aug 19, 2024
7 checks passed
@BobbieGoede
Copy link
Collaborator

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.

@DotwoodMedia DotwoodMedia deleted the feature/multi-domain-locales branch August 19, 2024 10:48
BobbieGoede pushed a commit that referenced this pull request Aug 19, 2024
Co-authored-by: Vincent de Vreede <[email protected]>
Co-authored-by: DarthGigi <[email protected]>
antoinezanardi referenced this pull request in antoinezanardi/werewolves-assistant-web-next Sep 10, 2024
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@nuxtjs/i18n](https://i18n.nuxtjs.org)
([source](https://redirect.github.com/nuxt-community/i18n-module)) |
[`^8.4.0` ->
`^8.5.2`](https://renovatebot.com/diffs/npm/@nuxtjs%2fi18n/8.4.0/8.5.2)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@nuxtjs%2fi18n/8.5.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@nuxtjs%2fi18n/8.5.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@nuxtjs%2fi18n/8.4.0/8.5.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@nuxtjs%2fi18n/8.4.0/8.5.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>nuxt-community/i18n-module (@&#8203;nuxtjs/i18n)</summary>

###
[`v8.5.2`](https://redirect.github.com/nuxt-modules/i18n/releases/tag/v8.5.2)

[Compare
Source](https://redirect.github.com/nuxt-community/i18n-module/compare/v8.5.1...v8.5.2)

#####    🐞 Bug Fixes

- Cookie being reset on reload in ssg build  -  by
[@&#8203;BobbieGoede](https://redirect.github.com/BobbieGoede) in
[https://github.com/nuxt-modules/i18n/issues/3087](https://redirect.github.com/nuxt-modules/i18n/issues/3087)
[<samp>(7ccaf)</samp>](https://redirect.github.com/nuxt-modules/i18n/commit/7ccaf160)

#####     [View changes on
GitHub](https://redirect.github.com/nuxt-modules/i18n/compare/v8.5.1...v8.5.2)

###
[`v8.5.1`](https://redirect.github.com/nuxt-modules/i18n/releases/tag/v8.5.1)

[Compare
Source](https://redirect.github.com/nuxt-community/i18n-module/compare/v8.5.0...v8.5.1)

#####    🐞 Bug Fixes

- Resolve plugin type import conflicts by updating module builder  -  by
[@&#8203;danielroe](https://redirect.github.com/danielroe) in
[#&#8203;3071](https://redirect.github.com/nuxt-community/i18n-module/issues/3071)

#####     [View changes on
GitHub](https://redirect.github.com/nuxt-modules/i18n/compare/v8.5.0...v8.5.1)

###
[`v8.5.0`](https://redirect.github.com/nuxt-modules/i18n/releases/tag/v8.5.0)

[Compare
Source](https://redirect.github.com/nuxt-community/i18n-module/compare/v8.4.0...v8.5.0)

#####    🚀 Features

- Add support for multi domain locales  -  by
[@&#8203;DotwoodMedia](https://redirect.github.com/DotwoodMedia),
**Vincent de Vreede** and **DarthGigi** in
[https://github.com/nuxt-modules/i18n/issues/3065](https://redirect.github.com/nuxt-modules/i18n/issues/3065)
[<samp>(93d62)</samp>](https://redirect.github.com/nuxt-modules/i18n/commit/93d62226)

#####     [View changes on
GitHub](https://redirect.github.com/nuxt-modules/i18n/compare/v8.4.0...v8.5.0)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/antoinezanardi/werewolves-assistant-web-next).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguNTkuMiIsInRhcmdldEJyYW5jaCI6ImRldmVsb3AiLCJsYWJlbHMiOltdfQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Antoine ZANARDI <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Different domains with multiple languages each
4 participants