Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

locale switching breaks on second switch #147

Open
SrgSteak opened this issue Nov 7, 2018 · 5 comments
Open

locale switching breaks on second switch #147

SrgSteak opened this issue Nov 7, 2018 · 5 comments

Comments

@SrgSteak
Copy link

SrgSteak commented Nov 7, 2018

How to reproduce:
check out project,
move to demo/cli dir
npm install
ng serve
go to /de/benutzer or /en/users
click translate to DE/EN
click other button EN/DE

Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'de/benutzer//%5Bobject%20Object%5D' noMatchError@http://localhost:4200/vendor.js:57472:25

@SrgSteak
Copy link
Author

SrgSteak commented Nov 7, 2018

Also,
switching from
http://localhost:4200/en/users/Ada%20Lovelace
with the translate button results in
http://localhost:4200/de/benutzer/Ada%20Lovelace;id=Ada%20Lovelace
and thats not helpful at all.

@meeroslav
Copy link
Collaborator

@SrgSteak, which version of localize-router is this - 1.0.1 or 2.0.0-RC.x?

@SrgSteak
Copy link
Author

SrgSteak commented Nov 7, 2018

2.0.0-RC.1 as you can find here:

"localize-router": "2.0.0-RC.1",

@qubiack
Copy link

qubiack commented Dec 5, 2018

We have exactly the sam problem - it always add ;id={PARAM} if we has a parameter in URL.

from package.json:
"localize-router": "^2.0.0-RC.2",

@lee-wilkins
Copy link

lee-wilkins commented Dec 7, 2018

I found this issue can be fixed by ensuring you have / at the start of your path to translate. I.e.:

this.localizeSvc.translateRoute('/dashboard/admin/')

or
[routerLink]="['/privacy-policy' | localize]"

or with params:
[routerLink]="['/authenticate/register/', monthlyContributions] | localize"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants