-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
Support redirectToDefaultLang in static mode? #77
Comments
Here's an example of what I mean, as borrowed from the README:
|
@justincy thank you a lot for your proposal!! 🚀 With "redirects" in static mode, do you mean that the browser does these redirects, doesn't it? (Router.replace) I guess that it will be interesting to add the new config prop
I will investigate the catch-all route, I never used before! 😄 |
I remember than @BjoernRave did a similar proposal here: #51, and we decided at that moment to don't bring this responsibility to the lib. However, if that feature is commonly used and it doesn't increase a lot the size of the lib, we can rethink it in order to implement it. |
Maybe we can provide more than one redirect mode:
|
That's a good idea. But if you don't want to bother with language detection, you could just leave the current functionality of redirecting to the default lang and add language detection later. |
Great!! 🎉 In order to finish this issue:
|
@justincy I did a prerelease under |
@justincy I realized that it works using some path, but when the path is just the homepage (localhost:3000), it displays a 404: |
Thanks. I'll look into that bug. |
@justincy I did a PR fixing some issues that I found (they are described in the PR). If you can take a look! |
Updating the README and adding tests makes sense to me. But the bit about custom server and middleware doesn't make sense to me. Doesn't it already exist here? Or is there something else you're asking for? |
Wow @justincy you are right! This is already existing!! hah! Ok, perfect! |
This will be available on |
It seems like we could support
redirectToDefaultLang
in static mode by using a catch-all route at the top level. That page could detect the language and perform the redirect accordingly.The text was updated successfully, but these errors were encountered: