When I am changing the language the route gets appended to previous routes instead of just changing the language for exe- http://localhost:4200/en/about-us if change the language to he then it becomes http://localhost:4200/he/about-us/about-us
I am changing the language like this.
constructor(
public translate: TranslateService,
private localize: LocalizeRouterService
){}
chooseLanguage('he') {
this.translate.use(lng);
this.localize.changeLanguage(lng)
}
Please let me know if I am doing something wrong
if you using ngx-translate you can change the language just by using the below method
if you want to change the route as well checkout out this solution Angular2 - route with language