Redirect after Login to correct locale

I have a multilingual site.

There is also a language chooser in the login page (User Login).

When a user choose a language or change a language it should go to correct locale.

the code i am using is

redirect = "dashboard"
paramCode = "code"
forceSecure = 0
requirePassword = 0

The page url is dashboard. and the local urls are

English => en/dashboard
German => dashboard

How can i achieve this?

Thanks alot

Is the sitepicker being used to change the locale? If so, I feel like it should work.


@apinard ah yeah. i forget to include the sitepicker Component