-
Notifications
You must be signed in to change notification settings - Fork 13
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
localePath
broken when using the default locale
#149
Comments
localPath
broken when using the default localelocalePath
broken when using the default locale
Hey! I know I have some problems with stratagies as it kept changing with nuxtjs-i18n betas. I planned on refactoring everything but I don't have much time :( You can already check the 4.0 branch but don't think it works yet |
Hi again, thanks for your reply, I managed to make it work in my environment while retaining the desired functionality, but the way I made it work leaves me to believe there might be something wrong with my solution. I simply removed this whole block, effectively removing modifiers for the nuxt-typed-router/src/core/parser/i18n.modifiers.ts Lines 28 to 42 in 673762d
The typing still works, while the routes are now correctly named, allowing navigation even in default. |
Describe the bug
Hello, the
localePath
method from i18n and all its derivative (NuxtLinkLocale for instance) always returns an empty string when the current locale is the default one.The method works again when nuxt-typed-router is removed from the modules.
I am using
prefix_and_default
as my i18n strategy and the latest version of nuxt-typed-router.After some digging, it seems that nuxt-typed-router removes the
___[locale]___default
suffix from the default route name, but i18n still localizes the route by suffixing with___[locale]___default
when using the default locale, causing the resolver to throw an error as there are no match found.Thank you for your work on this module, it is really helpful!
Expected behavior
the
localePath
method and its derivative should return the correct path if am using theprefix_and_defaut
strategy even if I am using the default locale.Screenshots
Environnement infos
Your
pages
folder structureYour nuxt.config.ts
The text was updated successfully, but these errors were encountered: