You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While this repository works perfectly fine when the locale is always defined, we need to add support for optional default locales so users can either visit /{default}/example-page or /example-page while both requests will result in the page being displayed in the default locale.
Suggested solution
We could utilize the optional route segment feature, but this does not support optional route parameters yet as we encounter the following error otherwise:
Error: Optional route parameters are not yet supported ("[[locale]]").
The text was updated successfully, but these errors were encountered:
After further tinkering around with internationalization of Next.js 14 apps I can gladly say: You can indeed make the default locale optional using rewrites and middleware. If anybody is interested in the implementation just upvote this comment and ?l'll create a separate branch for it. 🚀
Describe the new feature
While this repository works perfectly fine when the locale is always defined, we need to add support for optional default locales so users can either visit
/{default}/example-page
or/example-page
while both requests will result in the page being displayed in the default locale.Suggested solution
We could utilize the optional route segment feature, but this does not support optional route parameters yet as we encounter the following error otherwise:
Error: Optional route parameters are not yet supported ("[[locale]]").
The text was updated successfully, but these errors were encountered: