Closed darioielardi closed 3 months ago
Thank you for reporting and providing a good/complete description with reproduction! 🙏
Is the new behavior unexpected (and therefore a bug) or I'm missing something?
It seems like we didn't have tests for the previous behavior and the functionality got broken since it depended on the exclusion of strategy: 'no_prefix'
which is a bit confusing (I wasn't aware of this detail).
I'll see if I can figure out a fix soon, hopefully this week.
Environment
Darwin
v20.15.0
3.12.4
3.12.0
2.9.7
bun@1.1.22
-
compatibilityDate
,devtools
,modules
,i18n
@nuxtjs/i18n@8.3.3
-
Reproduction
https://github.com/darioielardi/nuxt-i18n-play
On
main
you'll find@nuxtjs/i18n@^8.3.3
installed. To test with@nuxtjs/i18n@8.2.0
switch to thenuxt-i18n-v8.2
branch.To test different domains you need to add this to your
hosts
file:Describe the bug
My use case is an application with a different domain for each locale, and localized paths. For example:
my-website.com/travels
my-website.it/viaggi
my-website.fr/voyages
Until
v8.2.0
, I would setdifferentDomains: true
, set up the locales with relative domains, add localized paths withcustomRoutes: 'config'
+pages
config, and it worked perfectly.From this PR (as someone noted in the comment) that doesn't work anymore, as it will add a locale prefix to every path, which is of course redundant and undesired in my case.
Adding
strategy: 'no_prefix'
doesn't work with custom paths (as it's stated in the docs), but in the case of different domains I think it's reasonable to expect that the prefix is omitted anyway (as it was inv8.2.0
), or at least to have some way to configure that.Is the new behavior unexpected (and therefore a bug) or I'm missing something? Let me know if you need any more context, and thanks for your great work!
Additional context
Related issue: https://github.com/nuxt-modules/i18n/issues/2729
Logs
No response