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
On the SSR Framework I am using Dynamic or more precise in my case Optional segemts for multi-language support as follows
route(":lang?/settings", "./Settings.tsx")
It works great, however it of course routes everything not being a language to the settings module as well. So, example.com/not_a_language_/settings works as well.
Is there a way to specify specific supported languages and direct the rest to the 404 page, without having to do a runtime validation within the Settings.tsx module nor a specifying a route for each language separately?
😍 My preferred would be the following. Despite it doesn't have access to the supportededLngs variable: route(":lang(de|fr|es)?/settings", "./Settings.tsx")
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
On the SSR Framework I am using Dynamic or more precise in my case Optional segemts for multi-language support as follows
route(":lang?/settings", "./Settings.tsx")
It works great, however it of course routes everything not being a language to the settings module as well. So, example.com/not_a_language_/settings works as well.
Is there a way to specify specific supported languages and direct the rest to the 404 page, without having to do a runtime validation within the
Settings.tsx
module nor a specifying a route for each language separately?😍 My preferred would be the following. Despite it doesn't have access to the supportededLngs variable:
route(":lang(de|fr|es)?/settings", "./Settings.tsx")
❌
route("de/settings", "./Settings.tsx")
route("fr/settings", "./Settings.tsx")
route("es/settings", "./Settings.tsx")
Finally, how is this handled by others, I assume simply by runtime validation within the module?
Beta Was this translation helpful? Give feedback.
All reactions