We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3847156 commit e7c557aCopy full SHA for e7c557a
src/app/services/translate/translate.service.ts
@@ -48,11 +48,16 @@ export class TranslateService {
48
49
private async addLocaleToSearchParams() {
50
const locale = await firstValueFrom(this.selectedLanguage$);
51
- const currentParams = this.router.getCurrentNavigation()?.extras?.queryParams;
+ const windowQueryParams = new URLSearchParams(window.location.search);
52
+ const queryParams = {
53
+ ...Object.fromEntries(windowQueryParams.entries()),
54
+ ...this.router.getCurrentNavigation()?.extras.state,
55
+ locale: locale,
56
+ };
57
58
this.router.navigate([], {
59
relativeTo: this.activatedRoute,
- queryParams: { ...currentParams, locale },
60
+ queryParams: queryParams,
61
queryParamsHandling: 'merge',
62
});
63
}
0 commit comments