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

Changing the language does not add prefix to the url #121

Open
stevengunneweg opened this issue Jan 13, 2022 · 2 comments
Open

Changing the language does not add prefix to the url #121

stevengunneweg opened this issue Jan 13, 2022 · 2 comments

Comments

@stevengunneweg
Copy link

I have a project set up with the latest Angular and latest ngx-translate and ngx-translate router. The alwaysSetPrefix property is set to false to not have a language prefix on the default language.
When I navigate within this project everything works as expected, the prefix is added/removed when necessary.
However when I change the language I see the translated url without prefix. When I refresh I end up in my wildcard route handling, the error page.

I created a simple example project to reproduce this (https://github.com/stevengunneweg/translate-router-test).

Is this an issue with my setup or is this an issue in the ngx-translate-router library? Please help.

@stevengunneweg
Copy link
Author

Is there anyone with a similar issue or insight on what might be the cause?

@stevengunneweg
Copy link
Author

After updating to Angular 14 (test project is updated) the behaviour is even worse. When I change the language the application navigates from http://localhost:4200/testin-en to http://localhost:4200/test-nl/test-nl.

The language prefix is completely lost and filled with the translated path which causes the path to show twice. When refreshing the route can obviously not be matched and thus the error page shows.

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

No branches or pull requests

1 participant