[v7] Two routes leading to the same file? #13112
Unanswered
tomekbuszewski
asked this question in
Q&A
Replies: 2 comments
-
Write a loader/action factory which resolves the locale from the URL and passes it as a parameter to the parameter function. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Why not make the prefix a param? route(":locale", "pages/locale.tsx", [
index("pages/home.tsx"),
route("something-else", "another-file.tsx")
]) Then in your routes |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey folks,
I have a peculiar problem, namely, I have a centralized content handled by a hook. So basically I set the language once in the context and then the translate hook is using it to decide which translation database it should query.
What I want is to have distinct urls: /en/whatever, /pl/whatever etc. I've solved it using prefixes:
But the problem is, it has to lead to a different file. Right now I am simply reexporting things inside /en/.tsx and /pl/.tsx, but this is quite poor solution.
What can I do to have both prefixes leading to the same file?
Beta Was this translation helpful? Give feedback.
All reactions