Multisite site picker changes to locale homepage

Hi, the new multisite feature looks awesome, though still getting used to it coming from old translate.
I noticed the default site picker changes the locale but always redirects to the homepage of that locale. Before, I’d use the following code to change the locale but still staying in the same page where the language picker was used:

<p>
    Switch language to:
    <a href="#" data-request="onSwitchLocale" data-request-data="locale: 'en'">English</a>,
    <a href="#" data-request="onSwitchLocale" data-request-data="locale: 'es'">Español</a>
</p>

I’d like to know how to do that now.
Thanks!

Could you share your sitepicker code? It works fine for me - after changing the language, the page is preserved.

I’m just using the default sitepicker component, but it redirects to the homepage of the selected locale/site.

Oh, it looks like there was a bug in the default sitepicker component. It was referring to site.base_url instead of site.url, which will indeed link to the homepage instead of the preserved page URL. It will be fixed in the next release, or you can use the example found in the docs:

1 Like