Loading namespaces based on route params? #60
brattonross
started this conversation in
Ideas
Replies: 1 comment
-
This sounds like a good idea, but I'm not really sure how it would work client side, if you have an idea on how to implement it, a PR is welcoming. |
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
-
Is there a way to load a namespace based on route params in v4?
In v3 we could use
params
from the loader function context and pass that togetTranslations
. However, in v4 we provide namespaces as strings in thehandle
export, so we don't have access to the route params.I think I can see it being possible to use the remix context in
entry.server.tsx
to add additional namespaces based on route matches, although I haven't looked into it too far. If it is possible, it would be nice if this library added an abstraction for this. e.g. being able to resolve a namespace via a function that gives access to the params:Am I missing a way to do this in v4? Would you be willing to add something like this to the library if not? (I am happy to contribute a PR for this if so)
Beta Was this translation helpful? Give feedback.
All reactions