-
-
Notifications
You must be signed in to change notification settings - Fork 500
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
Navigating to a non-existent URL with no defaultLocale defined throws a TypeError #9
Comments
Hi @bobcat1 |
From my point of view (biased because of my use case) it would be great if it had an option that let you redirect to a specific /prefix, if
Just an idea, I don't know how much work that would take and I'd be happy with any solution as long as it's working :) |
Upon further consideration of my specific use case outlined above, I might be shooting myself in the foot with the redirect suggestions I gave you, since I don't necessarily want to redirect to the same prefix every single time, but rather base the redirect on certain parameters (cookies, browser locale..). |
The way I see it, there should be a simple redirect option that would simply redirect |
That sounds like a great idea :) |
@bobcat1 thank you for asking the question. I am too looking to be able to set the language based on a cookie and or locale based on a geolocation service I'm using. @paulgv |
@bobcat1 The TypeError issue has been fixed in Nuxt 1.2.0 https://github.com/nuxt/nuxt.js/releases/tag/v1.2.0 @andrade1379 That's currently not possible since |
@bobcat1 just release v2.1.0 which comes with 2 new options |
@paulgv Just had the chance to try it now, it works great! Thanks for the superquick updates :) |
I'm trying to create a website with all content shown at
example.com/en
(or /fr, /es, /it etc.) So basically when you go to example.com, I want to redirect to /en /fr /es.. based on certain parameters, such as cookies and the browser locale.While trying to figure out a way to do this, the first step was skipping defining a
defaultLocale
. That way, all my languages are under their respective /locale/ url (it is also necessary to include the trailing slash, otherwise you get the error shown below).However, when navigating to a non-existent URL without a
defaultLocale
, you get:Instead of the usual
404 not found
that you get withdefaultLocale
defined.So what I'm asking is more or less; is this expected behaviour? Are you supposed to always use a
defaultLocale
? And do you have any suggestion as to how I can achieve what I am trying to achieve?Ps. Thank you for a truly superb module, the
localePath()
feature has helped me loads!The text was updated successfully, but these errors were encountered: