How to get selected locale from login page

Using keycloak version 15.2, we provide user with two locales on login page to select from. Changing the locale from dropdown changes the texts accordingly, but we are unable to get that selection to our Angular (13) app.

We are using keycloak- angular to get token from keycloak. Only problem is, received token has the locale associated with user profile, not the one selected on login page.

This used to work (getting the user locale selection in token) in version 3.x of Keycloak. What should we do to get it work with version 15.2?

Found a solution, you need to set the “update locale” action in “Authentication” => “Required actions” view.