penleychan / ngx-transloco-router

MIT License
10 stars 1 forks source link

Subroutes #8

Closed radim-kliment closed 1 year ago

radim-kliment commented 1 year ago

Is this library working with sub-routes? I have modules and submodules with routing and translation not woring on second level of routes domain.com/en/registration <- working domain.com/en/registration/step-one <- not-working

penleychan commented 1 year ago

Make sure you register the module. LocalizeRouterModule.forChild(routes). Refer to the demo app

radim-kliment commented 1 year ago

Yes Iam calling LocalizeRouterModule.forChild(routes):

I have:

penleychan commented 1 year ago

Since most of my production projects is running on ng13 I don't see the issue.

I created angular 14 version to test. Looks like something changed in angular 14 routing, seems like it is duplicating routes when changing language. Without you sharing the whole error, my assumption is that it is attempting to navigate to /en/registration/step-one/registration/step-one

Can you confirm if that's what's happening?

radim-kliment commented 1 year ago

It looks like it doesnt translate the route, because this routes working:

/en/registration/step-one /cs/registrace/step-one

but not this desired translated one: /cs/registrace/krok-jedna

penleychan commented 1 year ago

Hello,

Can you try the latest version. I've changed the version to 14.0.0 to match with angular versioning.

npm i @penleychan/ngx-transloco-router@14.0.0

I've also updated the demo app to somewhat similar to @gilsdav/ngx-translate-router

Regards

radim-kliment commented 1 year ago

Thanks, now it's working with latest version.