Open klis87 opened 5 years ago
Sure, It would be nice to support that if it can be done in a simple way.
I would probably start by writing some code that preprocesses a routesMap to get the behaviour you want (or as close as possible) and trying to find the minimum change that would support it in the router itself. I wonder if you can:
transformAction
in the default middleware pipeline (to fix up languages before the serialized URL is added to the action)Check out some of the simple examples for middlewares (e.g. the set page title package). There's alot of flexibility there over what was possible in RFR and the middleware API is they key to it. Also check out the toPath
/fromPath
options and such, they work a little differently.
Let me know if you need any help - I know documentation is sparse but I'm happy to point you in the right direction :)
Thx for detailed answer. When I have some time, I will to switch from RFR to Rudy and I will post the outcome how I solved multilang urls, I also agree that it would be best to use existing Rudy Api for this purposes, or with minimum adjustments, if not possible.
Hi, I am heavy user of redux first router and cannot wait for this library to become stable and documented.
In the meantime, I am wondering whether you will support better a case from RFR issue I posted some time ago https://github.com/faceyspacey/redux-first-router/issues/94
Ideally it would be great if all translation logic could be encapsulated in a route configuration, so we would not need to worry about going from
/en/home
to/de/haus
and vice versa, as home/haus could be calculated by this library based on and option/basenamethen,
/en/haus
and/de/home
would raise 404, and swithing basename when on/en/home
fromen
tode
would automatically recalculate url to/de/haus